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

Unified Diff: LayoutTests/http/tests/navigation/resources/navigate-during-commit.start.html

Issue 1164883002: Ignore attempts to navigate once a provisional commit has gotten too far along. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 months 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
Index: LayoutTests/http/tests/navigation/resources/navigate-during-commit.start.html
diff --git a/LayoutTests/http/tests/navigation/resources/navigate-during-commit.start.html b/LayoutTests/http/tests/navigation/resources/navigate-during-commit.start.html
new file mode 100644
index 0000000000000000000000000000000000000000..e8b70cf4101247905923e474c7dcc6dc9f2b2c08
--- /dev/null
+++ b/LayoutTests/http/tests/navigation/resources/navigate-during-commit.start.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+<script>
+// Induces an attempt to hash navigate while the SUCCESS_URL is being committed to the frame.
+// The tests succeeds if the SUCCESS_URL is loaded into the frame.
+
+function doIt() {
+ var SUCCESS_URL = "navigate-during-commit.success.html";
+ var VERY_SLOW_URL = "very-slow.php";
+ syncXhr(SUCCESS_URL); // Get it in the cache.
+ asyncXhr(VERY_SLOW_URL + "?" + window.randomNumber);
+ window.location = SUCCESS_URL;
+}
+
+function asyncXhr(url) {
+ var xhr = new XMLHttpRequest();
+ xhr.open("GET", url, true);
+ xhr.onreadystatechange = function() { if (xhr.readyState == 4) { window.location.hash="hashnav"; } }
+ xhr.send();
+}
+
+function syncXhr(url) {
+ var syncXhr = new XMLHttpRequest();
+ syncXhr.open("GET", url, false);
+ syncXhr.send();
+}
+
+</script>
+</head>
+<body onload="doIt()">
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698