Add regression test for Bug 150937
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Nov 2015 20:37:24 +0000 (20:37 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Nov 2015 20:37:24 +0000 (20:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150937

Reviewed by Geoffrey Garen.

Add regression test for Bug 150937:
Regression(r192038): Safari cannot load any pages

The new test makes sure that load deferring works as intended. The fix
for this already landed in r192060.

* loader/load-defer-expected.txt: Added.
* loader/load-defer.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192069 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/loader/load-defer-expected.txt [new file with mode: 0644]
LayoutTests/loader/load-defer.html [new file with mode: 0644]

index da58b70..5462887 100644 (file)
@@ -1,3 +1,19 @@
+2015-11-05  Chris Dumez  <cdumez@apple.com>
+
+        Add regression test for Bug 150937
+        https://bugs.webkit.org/show_bug.cgi?id=150937
+
+        Reviewed by Geoffrey Garen.
+
+        Add regression test for Bug 150937:
+        Regression(r192038): Safari cannot load any pages
+
+        The new test makes sure that load deferring works as intended. The fix
+        for this already landed in r192060.
+
+        * loader/load-defer-expected.txt: Added.
+        * loader/load-defer.html: Added.
+
 2015-11-05  Brady Eidson  <beidson@apple.com>
 
         Modern IDB: Implement IDBIndex get/getKey/count requests.
diff --git a/LayoutTests/loader/load-defer-expected.txt b/LayoutTests/loader/load-defer-expected.txt
new file mode 100644 (file)
index 0000000..3fc9ae8
--- /dev/null
@@ -0,0 +1,3 @@
+ALERT: Test that load deferring works as intended.
+ALERT: PASS: The frame loaded after loads were resumed.
+
diff --git a/LayoutTests/loader/load-defer.html b/LayoutTests/loader/load-defer.html
new file mode 100644 (file)
index 0000000..9cc8dd5
--- /dev/null
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+var testFrame;
+
+function loadedTooEarly()
+{
+    alert("FAIL: The frame loaded while loads were deferred.");
+    testRunner.notifyDone();
+}
+
+function passAndFinish()
+{
+    alert("PASS: The frame loaded after loads were resumed.");
+    testRunner.notifyDone();
+}
+
+function resumeLoads()
+{
+    testFrame.onload = passAndFinish;
+    if (window.testRunner)
+        testRunner.setDefersLoading(false);
+}
+
+function runTest()
+{
+    alert("Test that load deferring works as intended.");
+    if (window.testRunner)
+        testRunner.setDefersLoading(true);
+
+    testFrame = document.createElement("iframe");
+    testFrame.onload = loadedTooEarly;
+    testFrame.src = "resources/images.html";
+    document.body.appendChild(testFrame);
+    setTimeout(resumeLoads, 100);
+}
+
+</script>
+<body onload='runTest()'>
+</body>
+</html>