diff --git a/core/modules/system/lib/Drupal/system/Tests/Cache/AcceptCacheTest.php b/core/modules/system/lib/Drupal/system/Tests/Cache/AcceptCacheTest.php
new file mode 100644
index 0000000..0748a02
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Tests/Cache/AcceptCacheTest.php
@@ -0,0 +1,63 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\system\Tests\Cache\AcceptCacheTest.
+ */
+
+namespace Drupal\system\Tests\Cache;
+
+/**
+ * Tests cache clearing methods.
+ */
+use Drupal\simpletest\WebTestBase;
+
+class AcceptCacheTest extends WebTestBase {
+
+  /**
+   * Modules to enable
+   */
+  protected static $modules = array('cache_test');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Accept header caching',
+      'description' => 'Test page cache varies per accept-header.',
+      'group' => 'Cache'
+    );
+  }
+
+  public function setUp() {
+    parent::setUp();
+    // Enable page caching.
+    config('system.performance')->set('cache.page.use_internal', TRUE)
+      ->set('cache.page.max_age', 1)
+      ->save();
+  }
+
+  /**
+   * Tests page caching varies by Accept header.
+   */
+  public function testAcceptCaching() {
+    global $base_root;
+    $this->drupalGet('cache_test/content');
+    $content = $this->drupalGetContent();
+
+    $cache = cache('page')->get($base_root . '/cache_test/content');
+
+    $this->assertTrue($cache, 'Cache entry created for give page');
+
+    $ajax_result = $this->drupalGetAJAX('cache_test/content', array(), array('Accept: application/vnd.drupal-modal'));
+    $modal_expected_response = array(
+      'command' => 'openDialog',
+      'selector' => '#drupal-modal',
+      'settings' => NULL,
+      'data' => "And so castles made of sand melt into the sea, eventually.",
+      'dialogOptions' => array(
+        'modal' => TRUE,
+        'title' => 'Yes No Yes',
+      ),
+    );
+    $this->assertEqual($modal_expected_response, $ajax_result[1], "Expected modal returned with caching on");
+  }
+}
diff --git a/core/modules/system/tests/modules/cache_test/cache_test.routing.yml b/core/modules/system/tests/modules/cache_test/cache_test.routing.yml
new file mode 100644
index 0000000..026cdd9
--- /dev/null
+++ b/core/modules/system/tests/modules/cache_test/cache_test.routing.yml
@@ -0,0 +1,6 @@
+cache_test_accept:
+  pattern: '/cache_test/content'
+  defaults:
+    _content: 'Drupal\cache_test\CacheTestController::content'
+  requirements:
+    _access: 'TRUE'
diff --git a/core/modules/system/tests/modules/cache_test/lib/Drupal/cache_test/CacheTestController.php b/core/modules/system/tests/modules/cache_test/lib/Drupal/cache_test/CacheTestController.php
new file mode 100644
index 0000000..26721ff
--- /dev/null
+++ b/core/modules/system/tests/modules/cache_test/lib/Drupal/cache_test/CacheTestController.php
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\cache_test\CacheTestController
+ */
+namespace Drupal\cache_test;
+
+/**
+ * Controller for testing cache.
+ */
+class CacheTestController {
+
+  /**
+   * Controller to return chunk of content.
+   */
+  public function content() {
+    drupal_set_title('Yes No Yes');
+    return "And so castles made of sand melt into the sea, eventually.";
+  }
+}
