diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test
index f1e1bd5..1c91079 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/themes/tests/test_theme/template.php b/modules/simpletest/tests/themes/test_theme/template.php
similarity index 100%
rename from themes/tests/test_theme/template.php
rename to modules/simpletest/tests/themes/test_theme/template.php
diff --git a/themes/tests/test_theme/test_theme.info b/modules/simpletest/tests/themes/test_theme/test_theme.info
similarity index 100%
rename from themes/tests/test_theme/test_theme.info
rename to modules/simpletest/tests/themes/test_theme/test_theme.info
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index acbc843..83ea52f 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -1868,6 +1868,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 946ef0c..e8ae747 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -2465,6 +2465,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/themes/tests/update_test_basetheme/update_test_basetheme.info b/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info
similarity index 100%
rename from themes/tests/update_test_basetheme/update_test_basetheme.info
rename to modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info
diff --git a/themes/tests/update_test_subtheme/update_test_subtheme.info b/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
similarity index 100%
rename from themes/tests/update_test_subtheme/update_test_subtheme.info
rename to modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
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.
