mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444
This commit is contained in:
parent
25e8bf69e6
commit
665817d2a6
35333 changed files with 1818077 additions and 16036 deletions
|
@ -0,0 +1,24 @@
|
|||
<html>
|
||||
<head>
|
||||
<style>
|
||||
iframe { width: 400px; height: 300px;}
|
||||
</style>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
setup({explicit_timeout: true});
|
||||
|
||||
async_test(function(t) {
|
||||
window.addEventListener("message", t.step_func_done(function(e) {
|
||||
assert_equals(e.data, "BLOCKED", "The message should say 'BLOCKED'.");
|
||||
}));
|
||||
}, "The sandboxed iframe should post a message saying the top navigation was blocked when no user gesture.");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>This tests that an iframe in sandbox with 'allow-top-navigation-by-user-activation'
|
||||
can navigate the top level page, if it is trigged by a user gesture.</p>
|
||||
<p>Click on the button in the iframe and it should navigate the top page.</p>
|
||||
<iframe id="i" sandbox="allow-scripts allow-top-navigation-by-user-activation" src="support/iframe-that-performs-top-navigation.html"></iframe>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,19 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
async_test(function(t) {
|
||||
window.addEventListener("message", t.step_func_done(function(e) {
|
||||
assert_equals(e.data, "PASS", "The message should say 'PASS' instead of 'FAIL'");
|
||||
}));
|
||||
}, "The sandboxed iframe should post a message saying the test was in the state of 'PASS'.");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>This tests that an iframe in sandbox with 'allow-top-navigation-by-user-activation'
|
||||
cannot navigate its top level page, if it is not trigged by a user gesture.</p>
|
||||
<iframe sandbox='allow-top-navigation-by-user-activation allow-scripts' src="support/iframe-that-performs-top-navigation-without-user-gesture-failed.html"></iframe>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,16 @@
|
|||
<html>
|
||||
<body>
|
||||
The top navigation from this iframe should be blocked. This text should appear.
|
||||
<script>
|
||||
window.onload = function()
|
||||
{
|
||||
try {
|
||||
top.location = "navigation-changed-iframe.html";
|
||||
top.postMessage("FAIL", "*");
|
||||
} catch(e) {
|
||||
top.postMessage("PASS", "*");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<html>
|
||||
<head>
|
||||
<script>
|
||||
function performTest()
|
||||
{
|
||||
try {
|
||||
top.location = "navigation-changed-iframe.html";
|
||||
} catch(e) {
|
||||
top.postMessage("BLOCKED", "*");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="performTest();">
|
||||
<p>This doc tried to navigate the top page when loaded, which should fail since it's not trigged by user activation while in a sandboxed frame with 'allow-top-navigtaion-by-user-activation'. <br> <br>
|
||||
Click the button below, the top navigation should succeed with a new page saying "PASSED: Navigation succeeded." in browsers supporting the 'allow-top-navigtaion-by-user-activation' iframe@sandbox keyword (eg., Chrome v58+); Otherwise, the top navigation should fail.
|
||||
</p>
|
||||
<button id="b" onclick="performTest();">Navigate the top page</button>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,14 @@
|
|||
<html>
|
||||
<head>
|
||||
<script>
|
||||
function fireSentinel()
|
||||
{
|
||||
document.getElementsByTagName('h4')[0].innerHTML = document.domain;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="fireSentinel();">
|
||||
<h4>DOMAIN</h4>
|
||||
<p>PASSED: Navigation succeeded.</p>
|
||||
</body>
|
||||
</html>
|
|
@ -26,4 +26,12 @@
|
|||
assert_true((new Image()).namespaceURI === "http://www.w3.org/1999/xhtml");
|
||||
}, "Image namespace URI is correct");
|
||||
|
||||
test(function() {
|
||||
assert_equals(Image.name, "Image", "Image name should be Image (not HTMLImageElement)");
|
||||
assert_equals(Image.__proto__, Function.prototype, "Image __proto__ is Function prototype");
|
||||
assert_equals(Image.prototype, HTMLImageElement.prototype, "Image.prototype is same as HTMLImageElement.prototype");
|
||||
assert_equals(new Image().__proto__, HTMLImageElement.prototype, "Image __proto__ is HTMLImageElement prototype ");
|
||||
assert_equals(Image.prototype.__proto__, HTMLElement.prototype, "Image.prototype __proto__ is HTMLElement prototype");
|
||||
}, "NamedConstructor creates the correct object structure.");
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue