diff --git a/modules/simpletest/tests/cache.test b/modules/simpletest/tests/cache.test
index 47f2df3..084f131 100644
--- a/modules/simpletest/tests/cache.test
+++ b/modules/simpletest/tests/cache.test
@@ -411,3 +411,73 @@ class CacheIsEmptyCase extends CacheTestCase {
     $this->assertTrue(cache_is_empty($this->default_bin), t('The cache bin is empty'));
   }
 }
+
+/**
+ * Tests the behavior of the cache backend used for installing Drupal.
+ */
+class CacheInstallTestCase extends CacheTestCase {
+  protected $profile = 'testing';
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Cache install test',
+      'description' => 'Confirm that the cache backend used for installing Drupal works correctly.',
+      'group' => 'Cache',
+    );
+  }
+
+  function setUp() {
+    parent::setUp(array('cache_test'));
+  }
+
+  /**
+   * Tests the behavior of the cache backend used for installing Drupal.
+   *
+   * While Drupal is being installed, the cache system must deal with the fact
+   * that the database is not initially available, and, after it is available,
+   * the fact that other requests that take place while Drupal is being
+   * installed (for example, Ajax requests triggered via the installer's user
+   * interface) may cache data in the database, which needs to be cleared when
+   * the installer makes changes that would result in it becoming stale.
+   *
+   * We cannot test this process directly, so instead we test it by switching
+   * between the normal database cache (DrupalDatabaseCache) and
+   * the installer cache (DrupalFakeCache) while setting and
+   * clearing various items in the cache.
+   */
+  function testCacheInstall() {
+    $database_cache = new DrupalDatabaseCache('test');
+    $install_cache = new DrupalFakeCache('test');
+
+    // Store an item in the database cache, and confirm that the installer's
+    // cache backend recognizes that the cache is not empty.
+    $database_cache->set('cache_one', 'One');
+    $this->assertFalse($install_cache->isEmpty());
+    $database_cache->clear('cache_one');
+    $this->assertTrue($install_cache->isEmpty());
+
+    // Store an item in the database cache, then use the installer's cache
+    // backend to delete it. Afterwards, confirm that it is no longer in the
+    // database cache.
+    $database_cache->set('cache_one', 'One');
+    $this->assertEqual($database_cache->get('cache_one')->data, 'One');
+    $install_cache->clear('cache_one');
+    $this->assertFalse($database_cache->get('cache_one'));
+
+    // For each cache clearing event that we tried above, try it again after
+    // dropping the {cache_test} table. This simulates the early stages of the
+    // installer (when the database cache tables won't be available yet) and
+    // thereby confirms that the installer's cache backend does not produce
+    // errors if the installer ever calls any code early on that tries to clear
+    // items from the cache.
+    db_drop_table('cache_test');
+    try {
+      $install_cache->isEmpty();
+      $install_cache->clear('cache_one');
+      $this->pass("The installer's cache backend can be used even when the cache database tables are unavailable.");
+    }
+    catch (Exception $e) {
+      $this->fail("The installer's cache backend can be used even when the cache database tables are unavailable.");
+    }
+  }
+}
diff --git a/modules/simpletest/tests/modules/cache_test/cache_test.info b/modules/simpletest/tests/modules/cache_test/cache_test.info
new file mode 100644
index 0000000..095b6fd
--- /dev/null
+++ b/modules/simpletest/tests/modules/cache_test/cache_test.info
@@ -0,0 +1,6 @@
+name = "Cache test"
+description = "Support module for cache system testing."
+package = Testing
+version = VERSION
+core = 8.x
+hidden = TRUE
diff --git a/modules/simpletest/tests/modules/cache_test/cache_test.install b/modules/simpletest/tests/modules/cache_test/cache_test.install
new file mode 100644
index 0000000..5b50e11
--- /dev/null
+++ b/modules/simpletest/tests/modules/cache_test/cache_test.install
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * @file
+ * Install, update and uninstall functions for the cache_test module.
+ */
+
+/**
+ * Implements hook_schema().
+ */
+function cache_test_schema() {
+  $schema['cache_test'] = drupal_get_schema_unprocessed('system', 'cache');
+  $schema['cache_test']['description'] = 'Cache table for testing the cache system.';
+  return $schema;
+}
diff --git a/modules/simpletest/tests/modules/cache_test/cache_test.module b/modules/simpletest/tests/modules/cache_test/cache_test.module
new file mode 100644
index 0000000..3d2e68d
--- /dev/null
+++ b/modules/simpletest/tests/modules/cache_test/cache_test.module
@@ -0,0 +1,6 @@
+<?php
+
+/**
+ * @file
+ * Support module for testing the cache system.
+ */
