diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test
index d0ad77d..c630868 100644
--- a/modules/simpletest/tests/theme.test
+++ b/modules/simpletest/tests/theme.test
@@ -9,6 +9,8 @@
  * Unit tests for the Theme API.
  */
 class ThemeUnitTest extends DrupalWebTestCase {
+  protected $profile = 'testing';
+
   public static function getInfo() {
     return array(
       'name' => 'Theme API',
diff --git a/modules/simpletest/tests/theme_test.module b/modules/simpletest/tests/theme_test.module
index 160d192..9cec538 100644
--- a/modules/simpletest/tests/theme_test.module
+++ b/modules/simpletest/tests/theme_test.module
@@ -1,6 +1,14 @@
 <?php
 
 /**
+ * Implements hook_system_theme_info().
+ */
+function theme_test_system_theme_info() {
+  $themes['test_theme'] = drupal_get_path('module', 'theme_test') . '/themes/test_theme/test_theme.info';
+  return $themes;
+}
+
+/**
  * Implements hook_menu().
  */
 function theme_test_menu() {
diff --git a/modules/simpletest/tests/themes/test_theme/template.php b/modules/simpletest/tests/themes/test_theme/template.php
new file mode 100644
index 0000000..ef8118a
--- /dev/null
+++ b/modules/simpletest/tests/themes/test_theme/template.php
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Tests a theme overriding a suggestion of a base theme hook.
+ */
+function test_theme_breadcrumb__suggestion($variables) {
+  // Tests that preprocess functions for the base theme hook get called even
+  // when the suggestion has an implementation.
+  return 'test_theme_breadcrumb__suggestion: ' . $variables['theme_test_preprocess_breadcrumb'];
+}
+
+/**
+ * Tests a theme implementing an alter hook.
+ *
+ * The confusing function name here is due to this being an implementation of
+ * the alter hook invoked when the 'theme_test' module calls
+ * drupal_alter('theme_test_alter').
+ */
+function test_theme_theme_test_alter_alter(&$data) {
+  $data = 'test_theme_theme_test_alter_alter was invoked';
+}
diff --git a/modules/simpletest/tests/themes/test_theme/test_theme.info b/modules/simpletest/tests/themes/test_theme/test_theme.info
new file mode 100644
index 0000000..c32fe57
--- /dev/null
+++ b/modules/simpletest/tests/themes/test_theme/test_theme.info
@@ -0,0 +1,16 @@
+name = Test theme
+description = Theme for testing the theme system
+core = 8.x
+hidden = TRUE
+
+; Normally, themes may list CSS files like this, and if they exist in the theme
+; folder, then they get added to the page. If they have the same file name as a
+; module CSS file, then the theme's version overrides the module's version, so
+; that the module's version is not added to the page. Additionally, a theme may
+; have an entry like this one, without having the corresponding CSS file in the
+; theme's folder, and in this case, it just stops the module's version from
+; being loaded, and does not replace it with an alternate version. We have this
+; here in order for a test to ensure that this correctly prevents the module
+; version from being loaded, and that errors aren't caused by the lack of this
+; file within the theme folder.
+stylesheets[all][] = system.base.css
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index 69bc5db..465714b 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -1860,6 +1860,23 @@ function hook_module_implements_alter(&$implementations, $hook) {
 }
 
 /**
+ * Return additional themes provided by modules.
+ *
+ * This hook is invoked from _system_rebuild_theme_data() and allows modules to
+ * register additional themes outside of the regular 'themes' directories of a
+ * Drupal installation. It is most commonly used to register hidden themes for
+ * testing purposes.
+ *
+ * @return
+ *   An associative array. Each key is the system name of a theme and each value
+ *   is the corresponding path to the theme's .info file.
+ */
+function hook_system_theme_info() {
+  $themes['mymodule_test_theme'] = drupal_get_path('module', 'mymodule') . '/mymodule_test_theme/mymodule_test_theme.info';
+  return $themes;
+}
+
+/**
  * Alter the information parsed from module and theme .info files
  *
  * This hook is invoked in _system_rebuild_module_data() and in
diff --git a/modules/system/system.module b/modules/system/system.module
index 5af9ad4..8744413 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -2457,6 +2457,18 @@ function _system_update_bootstrap_status() {
 function _system_rebuild_theme_data() {
   // Find themes
   $themes = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.info$/', 'themes');
+  // Allow modules to add further themes.
+  if ($module_themes = module_invoke_all('system_theme_info')) {
+    foreach ($module_themes as $name => $uri) {
+      // @see file_scan_directory()
+      $themes[$name] = (object) array(
+        'uri' => $uri,
+        'filename' => pathinfo($uri, PATHINFO_FILENAME),
+        'name' => $name,
+      );
+    }
+  }
+
   // Find theme engines
   $engines = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.engine$/', 'themes/engines');
 
diff --git a/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info b/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info
new file mode 100644
index 0000000..c8550b5
--- /dev/null
+++ b/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info
@@ -0,0 +1,4 @@
+name = Update test base theme
+description = Test theme which acts as a base theme for other test subthemes.
+core = 8.x
+hidden = TRUE
diff --git a/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info b/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
new file mode 100644
index 0000000..c783dc2
--- /dev/null
+++ b/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
@@ -0,0 +1,5 @@
+name = Update test subtheme
+description = Test theme which uses update_test_basetheme as the base theme.
+core = 8.x
+base theme = update_test_basetheme
+hidden = TRUE
diff --git a/modules/update/tests/update_test.module b/modules/update/tests/update_test.module
index 4e32d33..2001162 100644
--- a/modules/update/tests/update_test.module
+++ b/modules/update/tests/update_test.module
@@ -1,6 +1,15 @@
 <?php
 
 /**
+ * Implements hook_system_theme_info().
+ */
+function update_test_system_theme_info() {
+  $themes['update_test_basetheme'] = drupal_get_path('module', 'update_test') . '/themes/update_test_basetheme/update_test_basetheme.info';
+  $themes['update_test_subtheme'] = drupal_get_path('module', 'update_test') . '/themes/update_test_subtheme/update_test_subtheme.info';
+  return $themes;
+}
+
+/**
  * Implements hook_menu().
  */
 function update_test_menu() {
diff --git a/themes/tests/README.txt b/themes/tests/README.txt
deleted file mode 100644
index 5ddaa8c..0000000
--- a/themes/tests/README.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-The themes in this subdirectory are all used by the Drupal core testing
-framework. They are not functioning themes that could be used on a real site
-and are hidden in the administrative user interface.
diff --git a/themes/tests/test_theme/template.php b/themes/tests/test_theme/template.php
deleted file mode 100644
index ef8118a..0000000
--- a/themes/tests/test_theme/template.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
- * Tests a theme overriding a suggestion of a base theme hook.
- */
-function test_theme_breadcrumb__suggestion($variables) {
-  // Tests that preprocess functions for the base theme hook get called even
-  // when the suggestion has an implementation.
-  return 'test_theme_breadcrumb__suggestion: ' . $variables['theme_test_preprocess_breadcrumb'];
-}
-
-/**
- * Tests a theme implementing an alter hook.
- *
- * The confusing function name here is due to this being an implementation of
- * the alter hook invoked when the 'theme_test' module calls
- * drupal_alter('theme_test_alter').
- */
-function test_theme_theme_test_alter_alter(&$data) {
-  $data = 'test_theme_theme_test_alter_alter was invoked';
-}
diff --git a/themes/tests/test_theme/test_theme.info b/themes/tests/test_theme/test_theme.info
deleted file mode 100644
index c32fe57..0000000
--- a/themes/tests/test_theme/test_theme.info
+++ /dev/null
@@ -1,16 +0,0 @@
-name = Test theme
-description = Theme for testing the theme system
-core = 8.x
-hidden = TRUE
-
-; Normally, themes may list CSS files like this, and if they exist in the theme
-; folder, then they get added to the page. If they have the same file name as a
-; module CSS file, then the theme's version overrides the module's version, so
-; that the module's version is not added to the page. Additionally, a theme may
-; have an entry like this one, without having the corresponding CSS file in the
-; theme's folder, and in this case, it just stops the module's version from
-; being loaded, and does not replace it with an alternate version. We have this
-; here in order for a test to ensure that this correctly prevents the module
-; version from being loaded, and that errors aren't caused by the lack of this
-; file within the theme folder.
-stylesheets[all][] = system.base.css
diff --git a/themes/tests/update_test_basetheme/update_test_basetheme.info b/themes/tests/update_test_basetheme/update_test_basetheme.info
deleted file mode 100644
index c8550b5..0000000
--- a/themes/tests/update_test_basetheme/update_test_basetheme.info
+++ /dev/null
@@ -1,4 +0,0 @@
-name = Update test base theme
-description = Test theme which acts as a base theme for other test subthemes.
-core = 8.x
-hidden = TRUE
diff --git a/themes/tests/update_test_subtheme/update_test_subtheme.info b/themes/tests/update_test_subtheme/update_test_subtheme.info
deleted file mode 100644
index c783dc2..0000000
--- a/themes/tests/update_test_subtheme/update_test_subtheme.info
+++ /dev/null
@@ -1,5 +0,0 @@
-name = Update test subtheme
-description = Test theme which uses update_test_basetheme as the base theme.
-core = 8.x
-base theme = update_test_basetheme
-hidden = TRUE
