forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145993 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
db54adc
commit 3707188
Showing
14 changed files
with
238 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,31 @@ | ||
2013-03-16 Mike West <[email protected]> | ||
|
||
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 <[email protected]> | ||
|
||
Update test expectations for content shell. | ||
|
11 changes: 11 additions & 0 deletions
11
LayoutTests/fast/frames/sandboxed-iframe-scripting-01-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
25 changes: 25 additions & 0 deletions
25
LayoutTests/fast/frames/sandboxed-iframe-scripting-01.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
|
12 changes: 12 additions & 0 deletions
12
LayoutTests/fast/frames/sandboxed-iframe-scripting-02-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
35 changes: 35 additions & 0 deletions
35
LayoutTests/fast/frames/sandboxed-iframe-scripting-02.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
|
||
|
12 changes: 12 additions & 0 deletions
12
LayoutTests/fast/frames/sandboxed-iframe-scripting-03-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
27 changes: 27 additions & 0 deletions
27
LayoutTests/fast/frames/sandboxed-iframe-scripting-03.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
|
||
|
||
|
12 changes: 12 additions & 0 deletions
12
LayoutTests/fast/frames/sandboxed-iframe-scripting-04-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
38 changes: 38 additions & 0 deletions
38
LayoutTests/fast/frames/sandboxed-iframe-scripting-04.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
|
||
|
||
|
||
|
11 changes: 11 additions & 0 deletions
11
LayoutTests/fast/frames/sandboxed-iframe-scripting-05-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
27 changes: 27 additions & 0 deletions
27
LayoutTests/fast/frames/sandboxed-iframe-scripting-05.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
|
||
|
||
|
||
|
||
|
14 changes: 0 additions & 14 deletions
14
LayoutTests/fast/frames/sandboxed-iframe-scripting-expected.txt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters