fast/frames/sandboxed-iframe-scripting is flakey
authormkwst@chromium.org <mkwst@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Mar 2013 16:43:39 +0000 (16:43 +0000)
committermkwst@chromium.org <mkwst@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Mar 2013 16:43:39 +0000 (16:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112482

Reviewed by Simon Fraser.

Tests that rely on multiple 'iframe' elements loading in a specific
order are a Bad Idea™. This patch splits
'fast/frames/sandboxed-iframe-scripting.html' out into five tests, and
changes two of them (#2 and #4) to use message passing in order to
test in a way that 'js-test-{pre,post}' can cleanly report.

* fast/frames/sandboxed-iframe-scripting-01-expected.txt: Added.
* fast/frames/sandboxed-iframe-scripting-01.html: Added.
* fast/frames/sandboxed-iframe-scripting-02-expected.txt: Added.
* fast/frames/sandboxed-iframe-scripting-02.html: Added.
* fast/frames/sandboxed-iframe-scripting-03-expected.txt: Added.
* fast/frames/sandboxed-iframe-scripting-03.html: Added.
* fast/frames/sandboxed-iframe-scripting-04-expected.txt: Added.
* fast/frames/sandboxed-iframe-scripting-04.html: Added.
* fast/frames/sandboxed-iframe-scripting-05-expected.txt: Added.
* fast/frames/sandboxed-iframe-scripting-05.html: Added.
* fast/frames/sandboxed-iframe-scripting-expected.txt: Removed.
* fast/frames/sandboxed-iframe-scripting.html: Removed.
* platform/mac/TestExpectations:
    Remove the skipped test, since it no longer exists.

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

14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/frames/sandboxed-iframe-scripting-01-expected.txt [new file with mode: 0644]
LayoutTests/fast/frames/sandboxed-iframe-scripting-01.html [new file with mode: 0644]
LayoutTests/fast/frames/sandboxed-iframe-scripting-02-expected.txt [new file with mode: 0644]
LayoutTests/fast/frames/sandboxed-iframe-scripting-02.html [new file with mode: 0644]
LayoutTests/fast/frames/sandboxed-iframe-scripting-03-expected.txt [new file with mode: 0644]
LayoutTests/fast/frames/sandboxed-iframe-scripting-03.html [new file with mode: 0644]
LayoutTests/fast/frames/sandboxed-iframe-scripting-04-expected.txt [new file with mode: 0644]
LayoutTests/fast/frames/sandboxed-iframe-scripting-04.html [new file with mode: 0644]
LayoutTests/fast/frames/sandboxed-iframe-scripting-05-expected.txt [new file with mode: 0644]
LayoutTests/fast/frames/sandboxed-iframe-scripting-05.html [new file with mode: 0644]
LayoutTests/fast/frames/sandboxed-iframe-scripting-expected.txt [deleted file]
LayoutTests/fast/frames/sandboxed-iframe-scripting.html [deleted file]
LayoutTests/platform/mac/TestExpectations

index 9488694..5d6b9f9 100644 (file)
@@ -1,3 +1,31 @@
+2013-03-16  Mike West  <mkwst@chromium.org>
+
+        fast/frames/sandboxed-iframe-scripting is flakey
+        https://bugs.webkit.org/show_bug.cgi?id=112482
+
+        Reviewed by Simon Fraser.
+
+        Tests that rely on multiple 'iframe' elements loading in a specific
+        order are a Bad Idea™. This patch splits
+        'fast/frames/sandboxed-iframe-scripting.html' out into five tests, and
+        changes two of them (#2 and #4) to use message passing in order to
+        test in a way that 'js-test-{pre,post}' can cleanly report.
+
+        * fast/frames/sandboxed-iframe-scripting-01-expected.txt: Added.
+        * fast/frames/sandboxed-iframe-scripting-01.html: Added.
+        * fast/frames/sandboxed-iframe-scripting-02-expected.txt: Added.
+        * fast/frames/sandboxed-iframe-scripting-02.html: Added.
+        * fast/frames/sandboxed-iframe-scripting-03-expected.txt: Added.
+        * fast/frames/sandboxed-iframe-scripting-03.html: Added.
+        * fast/frames/sandboxed-iframe-scripting-04-expected.txt: Added.
+        * fast/frames/sandboxed-iframe-scripting-04.html: Added.
+        * fast/frames/sandboxed-iframe-scripting-05-expected.txt: Added.
+        * fast/frames/sandboxed-iframe-scripting-05.html: Added.
+        * fast/frames/sandboxed-iframe-scripting-expected.txt: Removed.
+        * fast/frames/sandboxed-iframe-scripting.html: Removed.
+        * platform/mac/TestExpectations:
+            Remove the skipped test, since it no longer exists.
+
 2013-03-16  Jochen Eisinger  <jochen@chromium.org>
 
         Update test expectations for content shell.
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-scripting-01-expected.txt b/LayoutTests/fast/frames/sandboxed-iframe-scripting-01-expected.txt
new file mode 100644 (file)
index 0000000..2f8b39b
--- /dev/null
@@ -0,0 +1,11 @@
+Verify that sandboxed frames with sandbox='allow-scripts' can execute script.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS disallowedExecuted is 0
+PASS allowedExecuted is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-scripting-01.html b/LayoutTests/fast/frames/sandboxed-iframe-scripting-01.html
new file mode 100644 (file)
index 0000000..6668668
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script src="../js/resources/js-test-pre.js"></script>
+    <script>
+        var allowedExecuted = 0;
+        var disallowedExecuted = 0;
+        window.onload = function() {
+            shouldBe("disallowedExecuted", "0");
+            shouldBe("allowedExecuted", "1");
+
+            isSuccessfullyParsed();
+        };
+    </script>
+</head>
+<body>
+    <iframe sandbox="allow-same-origin allow-scripts"
+            src="javascript: ++window.top.allowedExecuted;">
+    </iframe>
+    <script>
+        description("Verify that sandboxed frames with sandbox='allow-scripts' can execute script.");
+    </script>
+</body>
+</html>
+
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-scripting-02-expected.txt b/LayoutTests/fast/frames/sandboxed-iframe-scripting-02-expected.txt
new file mode 100644 (file)
index 0000000..ce7f208
--- /dev/null
@@ -0,0 +1,12 @@
+ALERT: PASS: Executed script in data URL
+Verify that sandboxed frames with sandbox='allow-scripts' can execute script from data: URLs.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS disallowedExecuted is 0
+PASS allowedExecuted is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-scripting-02.html b/LayoutTests/fast/frames/sandboxed-iframe-scripting-02.html
new file mode 100644 (file)
index 0000000..56a1dc8
--- /dev/null
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script src="../js/resources/js-test-pre.js"></script>
+    <script>
+        window.jsTestIsAsync = true;
+
+        var allowedExecuted = 0;
+        var disallowedExecuted = 0;
+        window.addEventListener('message', function () {
+          allowedExecuted++;
+
+          finish();
+        });
+
+        function finish() {
+            shouldBe("disallowedExecuted", "0");
+            shouldBe("allowedExecuted", "1");
+
+            finishJSTest();
+        };
+    </script>
+    <script src="../js/resources/js-test-post.js"></script>
+</head>
+<body>
+    <iframe sandbox="allow-same-origin allow-scripts"
+            src="data:text/html,<script>alert('PASS: Executed script in data URL');window.parent.postMessage({'pass': true}, '*');</script>">
+    </iframe>
+    <script>
+        description("Verify that sandboxed frames with sandbox='allow-scripts' can execute script from data: URLs.");
+    </script>
+</body>
+</html>
+
+
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-scripting-03-expected.txt b/LayoutTests/fast/frames/sandboxed-iframe-scripting-03-expected.txt
new file mode 100644 (file)
index 0000000..4aeb68c
--- /dev/null
@@ -0,0 +1,12 @@
+CONSOLE MESSAGE: Blocked script execution in 'about:blank' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
+Verify that sandboxed frames without sandbox='allow-scripts' cannot execute script.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS disallowedExecuted is 0
+PASS allowedExecuted is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-scripting-03.html b/LayoutTests/fast/frames/sandboxed-iframe-scripting-03.html
new file mode 100644 (file)
index 0000000..3f49e37
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script src="../js/resources/js-test-pre.js"></script>
+    <script>
+        var allowedExecuted = 0;
+        var disallowedExecuted = 0;
+        window.onload = function() {
+            shouldBe("disallowedExecuted", "0");
+            shouldBe("allowedExecuted", "0");
+
+            isSuccessfullyParsed();
+        };
+    </script>
+</head>
+<body>
+    <iframe sandbox="allow-same-origin"
+            src="javascript: ++window.top.disallowedExecuted;">
+    </iframe>
+    <script>
+        description("Verify that sandboxed frames without sandbox='allow-scripts' cannot execute script.");
+    </script>
+</body>
+</html>
+
+
+
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-scripting-04-expected.txt b/LayoutTests/fast/frames/sandboxed-iframe-scripting-04-expected.txt
new file mode 100644 (file)
index 0000000..9df9346
--- /dev/null
@@ -0,0 +1,12 @@
+CONSOLE MESSAGE: Blocked script execution in 'data:text/html,<script>alert('FAIL: Executed script without allow-scripts in data URL');window.parent.postMessage({'fail': true}, '*');</script>' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
+Verify that sandboxed frames without sandbox='allow-scripts' cannot execute script from data: URLs.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS disallowedExecuted is 0
+PASS allowedExecuted is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-scripting-04.html b/LayoutTests/fast/frames/sandboxed-iframe-scripting-04.html
new file mode 100644 (file)
index 0000000..8186ef9
--- /dev/null
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script src="../js/resources/js-test-pre.js"></script>
+    <script>
+        window.jsTestIsAsync = true;
+
+        var allowedExecuted = 0;
+        var disallowedExecuted = 0;
+        window.addEventListener('message', function () {
+          disallowedExecuted++;
+
+          finish();
+        });
+
+        function finish() {
+            shouldBe("disallowedExecuted", "0");
+            shouldBe("allowedExecuted", "0");
+
+            finishJSTest();
+        };
+    </script>
+    <script src="../js/resources/js-test-post.js"></script>
+</head>
+<body>
+    <iframe sandbox="allow-same-origin"
+            onload="finish()"
+            src="data:text/html,<script>alert('FAIL: Executed script without allow-scripts in data URL');window.parent.postMessage({'fail': true}, '*');</script>">
+    </iframe>
+    <script>
+        description("Verify that sandboxed frames without sandbox='allow-scripts' cannot execute script from data: URLs.");
+    </script>
+</body>
+</html>
+
+
+
+
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-scripting-05-expected.txt b/LayoutTests/fast/frames/sandboxed-iframe-scripting-05-expected.txt
new file mode 100644 (file)
index 0000000..a85e995
--- /dev/null
@@ -0,0 +1,11 @@
+Verify that adding a sandbox attribute at runtime does not effect the iframe's current state.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS disallowedExecuted is 0
+PASS allowedExecuted is 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-scripting-05.html b/LayoutTests/fast/frames/sandboxed-iframe-scripting-05.html
new file mode 100644 (file)
index 0000000..e336c36
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script src="../js/resources/js-test-pre.js"></script>
+    <script>
+        var allowedExecuted = 0;
+        var disallowedExecuted = 0;
+        window.onload = function() {
+            shouldBe("disallowedExecuted", "0");
+            shouldBe("allowedExecuted", "2");
+
+            isSuccessfullyParsed();
+        };
+    </script>
+</head>
+<body>
+    <iframe id="frame" src="resources/sandboxed-iframe-script-dynamic.html"></iframe>
+    <script>
+        description("Verify that adding a sandbox attribute at runtime does not effect the iframe's current state.");
+    </script>
+</body>
+</html>
+
+
+
+
+
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-scripting-expected.txt b/LayoutTests/fast/frames/sandboxed-iframe-scripting-expected.txt
deleted file mode 100644 (file)
index 9ad96b4..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-CONSOLE MESSAGE: Blocked script execution in 'about:blank' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
-ALERT: PASS: Executed script in data URL
-CONSOLE MESSAGE: Blocked script execution in 'data:text/html,<script> alert('FAIL: Executed script without allow-scripts in data URL'); </script>' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
-Verify that sandboxed frames with sandbox="allow-scripts" can execute scripts, but other sandboxed frames cannot. Also verify that adding a sandbox attribute at runtime does not effect the current state of the iframe.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS disallowedExecuted is 0
-PASS allowedExecuted is 3
-PASS successfullyParsed is true
-
-TEST COMPLETE
-      
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-scripting.html b/LayoutTests/fast/frames/sandboxed-iframe-scripting.html
deleted file mode 100644 (file)
index 7f31052..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>
-<head>
-<script src="../js/resources/js-test-pre.js"></script>
-<script>
-if (window.testRunner)
-    window.testRunner.dumpAsText();
-
-var disallowedExecuted = 0;
-var allowedExecuted = 0;
-
-window.onload = function()
-{
-    shouldBe("disallowedExecuted", "0");
-    shouldBe("allowedExecuted", "3");
-
-    isSuccessfullyParsed();
-}
-</script>
-</head>
-
-<body>
-    <iframe sandbox="allow-same-origin allow-scripts"
-            src="javascript: ++window.top.allowedExecuted;">
-    </iframe>
-    <iframe sandbox="allow-same-origin allow-scripts"
-            src="data:text/html,<script> alert('PASS: Executed script in data URL'); </script>">
-    </iframe>
-    <iframe sandbox="allow-same-origin"
-            src="javascript: ++window.top.disallowedExecuted;">
-    </iframe>
-    <iframe sandbox="allow-same-origin"
-            src="data:text/html,<script> alert('FAIL: Executed script without allow-scripts in data URL'); </script>">
-    </iframe>
-
-    <iframe id="frame" src="resources/sandboxed-iframe-script-dynamic.html">
-    </iframe>
-
-    <script>
-    description("Verify that sandboxed frames with sandbox=&quot;allow-scripts&quot; can execute scripts, "
-                 + "but other sandboxed frames cannot. Also verify that adding a sandbox attribute at runtime "
-                 + "does not effect the current state of the iframe.");
-    </script>
-</body>
-</html>
index 00dccaf..33fdad7 100644 (file)
@@ -1350,8 +1350,6 @@ webkit.org/b/104954 http/tests/canvas/canvas-slow-font-loading.html [ ImageOnlyF
 
 webkit.org/b/104962 platform/mac/fast/loader/file-url-mimetypes-2.html [ Failure ]
 
-webkit.org/b/112482 fast/frames/sandboxed-iframe-scripting.html [ Failure Pass ]
-
 webkit.org/b/105601 svg/zoom/page/zoom-replaced-intrinsic-ratio-001.htm [ Crash Pass ]
 
 webkit.org/b/105603 http/tests/cookies/single-quoted-value.html [ Failure Pass ]