diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
index 30d8422..6e884a1 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
@@ -231,4 +231,14 @@ class ThemeTest extends WebTestBase {
     $this->drupalGet('admin/structure/block');
     $this->assertText('Stark(' . t('active tab') . ')', t('Default local task on blocks admin page has changed.'));
   }
+
+  /**
+   * Test that themes can't be enabled when the base theme or engine is missing.
+   */
+  function testInvalidTheme() {
+    module_enable(array('theme_page_test'));
+    $this->drupalGet('admin/appearance');
+    $this->assertText('This theme requires the base theme not_real_test_basetheme to operate correctly.', t('Invalid base theme check succeeded.'));
+    $this->assertText('This theme requires the theme engine not_real_engine to operate correctly.', t('Invalid theme engine check succeeded.'));
+  }
 }
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index 819df67..130b0e7 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -155,10 +155,14 @@ function system_themes_page() {
      // content has a common place in all themes.
       $theme->incompatible_core = !isset($theme->info['core']) || ($theme->info['core'] != DRUPAL_CORE_COMPATIBILITY) || (!isset($theme->info['regions']['content']));
       $theme->incompatible_php = version_compare(phpversion(), $theme->info['php']) < 0;
+      // Confirmed that the base theme is available.
+      $theme->incompatible_base = (isset($theme->info['base theme']) && !isset($themes[$theme->info['base theme']]));
+      // Confirm that the theme engine is available.
+      $theme->incompatible_engine = (isset($theme->info['engine']) && !isset($theme->owner));
     }
     $query['token'] = drupal_get_token('system-theme-operation-link');
     $theme->operations = array();
-    if (!empty($theme->status) || !$theme->incompatible_core && !$theme->incompatible_php) {
+    if (!empty($theme->status) || !$theme->incompatible_core && !$theme->incompatible_php && !$theme->incompatible_base && !$theme->incompatible_engine) {
       // Create the operations links.
       $query['theme'] = $theme->name;
       if (drupal_theme_access($theme)) {
@@ -2698,6 +2702,12 @@ function theme_system_themes_page($variables) {
         }
         $output .= '<div class="incompatible">' . t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $theme->info['php'], '!php_version' => phpversion())) . '</div>';
       }
+      elseif (!empty($theme->incompatible_base)) {
+        $output .= '<div class="incompatible">' . t('This theme requires the base theme @base_theme to operate correctly.', array('@base_theme' => $theme->info['base theme'])) . '</div>';
+      }
+      elseif (!empty($theme->incompatible_engine)) {
+        $output .= '<div class="incompatible">' . t('This theme requires the theme engine @theme_engine to operate correctly.', array('@theme_engine' => $theme->info['engine'])) . '</div>';
+      }
       else {
         $output .= theme('links', array('links' => $theme->operations, 'attributes' => array('class' => array('operations', 'clearfix'))));
       }
diff --git a/core/modules/system/tests/modules/theme_page_test/theme_page_test.info b/core/modules/system/tests/modules/theme_page_test/theme_page_test.info
new file mode 100644
index 0000000..78e5bb4
--- /dev/null
+++ b/core/modules/system/tests/modules/theme_page_test/theme_page_test.info
@@ -0,0 +1,6 @@
+name = "Theme page test"
+description = "Support module for theme system testing."
+package = Testing
+version = VERSION
+core = 8.x
+
diff --git a/core/modules/system/tests/modules/theme_page_test/theme_page_test.module b/core/modules/system/tests/modules/theme_page_test/theme_page_test.module
new file mode 100644
index 0000000..fe86da9
--- /dev/null
+++ b/core/modules/system/tests/modules/theme_page_test/theme_page_test.module
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Implements hook_system_info_alter().
+ */
+function theme_page_test_system_info_alter(&$info, $file, $type) {
+  // Make sure that all themes are visible on the Appearance form.
+  if ($type == 'theme') {
+    unset($info['hidden']);
+  }
+}
+
+
+/**
+ * Implements hook_system_theme_info().
+ */
+function theme_page_test_system_theme_info() {
+  $themes['test_invalid_basetheme'] = drupal_get_path('module', 'system') . '/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info';
+  $themes['test_invalid_engine'] = drupal_get_path('module', 'system') . '/tests/themes/test_invalid_engine/test_invalid_engine.info';
+  return $themes;
+}
\ No newline at end of file
diff --git a/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info b/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info
new file mode 100644
index 0000000..915a5c7
--- /dev/null
+++ b/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info
@@ -0,0 +1,5 @@
+name = Theme test with invalid base theme
+description = Test theme which has a non-existent base theme.
+core = 8.x
+base theme = not_real_test_basetheme
+hidden = TRUE
diff --git a/core/modules/system/tests/themes/test_invalid_engine/test_invalid_engine.info b/core/modules/system/tests/themes/test_invalid_engine/test_invalid_engine.info
new file mode 100644
index 0000000..335600d
--- /dev/null
+++ b/core/modules/system/tests/themes/test_invalid_engine/test_invalid_engine.info
@@ -0,0 +1,5 @@
+name = Theme test with invalid theme engine
+description = Test theme which has a non-existent theme engine.
+core = 8.x
+hidden = TRUE
+engine = not_real_engine
\ No newline at end of file
