Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(827)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/cache/location-reload.html

Issue 2555963003: FasterLocationReload: use ReloadMainResource for JS exposed reloads (Closed)
Patch Set: review #20 Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/cache/resources/location-reload-window.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/cache/location-reload.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/cache/location-reload.html b/third_party/WebKit/LayoutTests/http/tests/cache/location-reload.html
new file mode 100644
index 0000000000000000000000000000000000000000..b069a032e1c0daebad1888e440c651d8d0e98471
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/cache/location-reload.html
@@ -0,0 +1,41 @@
+<!DOCYUPE html>
+<h1>random</h1>
tkent 2016/12/14 22:59:43 Is this necessary?
Takashi Toyoshima 2016/12/15 04:45:32 Oops, this should be moved into resource/location-
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+
+async_test(t => {
+ let testWindow = null;
+ let messageCount = 0;
+
+ // Test will run on testWindow that is opened below.
+ // This page just received messages to confirm if tests run expectedly.
+ const checkReady = e => {
+ t.step(() => {
+ // Will receive "READY" twice because of a reload, then receive "PASS".
+ assert_equals(e.data, "READY", "received message is " + e.data);
+ messageCount++;
+
+ if (messageCount == 2) {
+ window.removeEventListener("message", checkReady, false);
+ window.addEventListener("message", e => {
+ assert_equals(e.data, "PASS", "received message is " + e.data);
+ t.done();
+ }, { once: true });
+ }
+
+ // Send back "START" message for "READY".
+ assert_class_string(testWindow, "Window", "testWindow is invalid");
+ testWindow.postMessage("START", location.origin);
+ });
+ };
+ window.addEventListener("message", checkReady, false);
+
+ // Start a test in a dedicated window because we can not track navigations
+ // within a test harness.
+ t.step(() => {
+ testWindow = open("./resources/location-reload-window.html", "testWindow");
+ assert_class_string(testWindow, "Window", "window.open() failed");
+ });
+}, "Test location.reload() cache behaviors");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/cache/resources/location-reload-window.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698