Layout Test plugins/access-after-page-destroyed.html is flaky
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Sep 2013 21:07:27 +0000 (21:07 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Sep 2013 21:07:27 +0000 (21:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=121976

Reviewed by Anders Carlsson.

Clean up the test.

* plugins/access-after-page-destroyed-2-expected.txt: Added.
* plugins/access-after-page-destroyed-2.html: Copied from LayoutTests/plugins/access-after-page-destroyed.html.
This was testing two distinct issues, the second one unfittingly piled onto the first.
Split the test in two.

* plugins/access-after-page-destroyed-expected.txt:
* plugins/access-after-page-destroyed.html:
Modernized the test with js-test scripts, added a gc() call for predictability,
changed the test to fail quickly in the flaky case.

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

LayoutTests/ChangeLog
LayoutTests/plugins/access-after-page-destroyed-2-expected.txt [new file with mode: 0644]
LayoutTests/plugins/access-after-page-destroyed-2.html [new file with mode: 0644]
LayoutTests/plugins/access-after-page-destroyed-expected.txt
LayoutTests/plugins/access-after-page-destroyed.html

index c6f8e11..6e35861 100644 (file)
@@ -1,5 +1,24 @@
 2013-09-26  Alexey Proskuryakov  <ap@apple.com>
 
+        Layout Test plugins/access-after-page-destroyed.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=121976
+
+        Reviewed by Anders Carlsson.
+
+        Clean up the test.
+
+        * plugins/access-after-page-destroyed-2-expected.txt: Added.
+        * plugins/access-after-page-destroyed-2.html: Copied from LayoutTests/plugins/access-after-page-destroyed.html.
+        This was testing two distinct issues, the second one unfittingly piled onto the first.
+        Split the test in two.
+
+        * plugins/access-after-page-destroyed-expected.txt:
+        * plugins/access-after-page-destroyed.html:
+        Modernized the test with js-test scripts, added a gc() call for predictability,
+        changed the test to fail quickly in the flaky case.
+
+2013-09-26  Alexey Proskuryakov  <ap@apple.com>
+
         fast/css/font-face-data-uri.html is failing
         https://bugs.webkit.org/show_bug.cgi?id=82744
 
diff --git a/LayoutTests/plugins/access-after-page-destroyed-2-expected.txt b/LayoutTests/plugins/access-after-page-destroyed-2-expected.txt
new file mode 100644 (file)
index 0000000..c725dbc
--- /dev/null
@@ -0,0 +1,6 @@
+If the page does not trigger a crash the test passed.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/plugins/access-after-page-destroyed-2.html b/LayoutTests/plugins/access-after-page-destroyed-2.html
new file mode 100644 (file)
index 0000000..fafcb12
--- /dev/null
@@ -0,0 +1,41 @@
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body>
+<p>If the page does not trigger a crash the test passed.</p>
+<div id=console></div>
+<script>
+if (window.testRunner)
+    testRunner.setCanOpenWindows();
+
+jsTestIsAsync = true;
+
+function test()
+{
+    var w = open();
+    var p = w.navigator.mimeTypes.item(0);
+    if (!p)
+        testFailed("navigator.mimeTypes is " + p);
+    w.navigator.plugins.refresh();
+    w.close();
+    w = null;
+
+    setTimeout(gc, 0);
+
+    setTimeout(function() {
+        try {
+            p.enabledPlugin;
+        } catch (ex) {
+            testFailed(ex.toString());
+        }
+        finishJSTest();
+    }, 50); // Pause is necessary for the page to get freed
+}
+
+onload = test;
+
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
index 735404e..c725dbc 100644 (file)
@@ -1 +1,6 @@
 If the page does not trigger a crash the test passed.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
index 61630cf..1246624 100644 (file)
@@ -1,30 +1,40 @@
 <html>
 <head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body>
+<p>If the page does not trigger a crash the test passed.</p>
+<div id=console></div>
 <script>
-if (window.testRunner) {
+if (window.testRunner)
     testRunner.setCanOpenWindows();
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
 
-var w = open();
-var p = w.navigator.mimeTypes.item(0);
-w.close();
-w = open();
-p = w.navigator.mimeTypes.item(0);
-w.navigator.plugins.refresh();
-w.close();
-w = null;
+jsTestIsAsync = true;
 
-setTimeout(function(){
-    p.enabledPlugin;
-    if (window.testRunner)
-        testRunner.notifyDone();
-}, 50); // Pause is necessary for the page to get freed
+function test()
+{
+    var w = open();
+    var p = w.navigator.mimeTypes.item(0);
+    if (!p)
+        testFailed("navigator.mimeTypes is " + p);
+    w.close();
+    w = null;
+
+    setTimeout(gc, 0);
+
+    setTimeout(function() {
+        try {
+            p.enabledPlugin;
+        } catch (ex) {
+            testFailed(ex.toString());
+        }
+        finishJSTest();
+    }, 50); // Pause is necessary for the page to get freed
+}
+
+onload = test;
 
 </script>
-</head>
-<body>
-If the page does not trigger a crash the test passed.
+<script src="../resources/js-test-post.js"></script>
 </body>
 </html>