Update web-platform-tests to revision dc5cbf088edcdb266541d4e5a76149a2c6e716a0

This commit is contained in:
Ms2ger 2016-09-09 09:40:35 +02:00
parent 1d40075f03
commit 079092dfea
2381 changed files with 90360 additions and 17722 deletions

View file

@ -11,18 +11,12 @@ test(function() {
valueOf: function() { throw Error() }
};
var tests = [
[function() { return Audio() }, null, "No arguments, without new"],
[function() { return new Audio() }, null, "No arguments, with new"],
[function() { return Audio("") }, "", "Empty string argument, without new"],
[function() { return new Audio("") }, "", "Empty string argument, with new"],
[function() { return Audio("src") }, "src", "Non-empty string argument, without new"],
[function() { return new Audio("src") }, "src", "Non-empty string argument, with new"],
[function() { return Audio(null) }, "null", "Null argument, without new"],
[function() { return new Audio(null) }, "null", "Null argument, with new"],
[function() { return Audio(undefined) }, null, "Undefined argument, without new"],
[function() { return new Audio(undefined) }, null, "Undefined argument, with new"],
[function() { return Audio("", throwingObject) }, "", "Extra argument, without new"],
[function() { return new Audio("", throwingObject) }, "", "Extra argument, with new"],
[function() { return new Audio() }, null, "No arguments"],
[function() { return new Audio("") }, "", "Empty string argument"],
[function() { return new Audio("src") }, "src", "Non-empty string argument"],
[function() { return new Audio(null) }, "null", "Null argument"],
[function() { return new Audio(undefined) }, null, "Undefined argument"],
[function() { return new Audio("", throwingObject) }, "", "Extra argument"],
];
tests.forEach(function(t) {
var fn = t[0], expectedSrc = t[1], description = t[2];
@ -38,6 +32,11 @@ test(function() {
}, description);
});
});
test(function() {
assert_throws(new TypeError(), function() {
Audio();
});
}, "Calling Audio should throw");
test(function() {
assert_throws(new TypeError(), function() {
HTMLAudioElement();

View file

@ -1,13 +1,13 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>Canvas test: security.drawImage.canvas.sub</title>
<title>Canvas test: security.drawImage.canvas</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<link rel="stylesheet" href="/common/canvas-tests.css">
<body class="show_output">
<h1>security.drawImage.canvas.sub</h1>
<h1>security.drawImage.canvas</h1>
<p class="desc">drawImage of unclean canvas makes the canvas origin-unclean</p>
@ -31,5 +31,6 @@ assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
});
</script>
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
<script src="/common/get-host-info.sub.js"></script>
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>

View file

@ -1,13 +1,13 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>Canvas test: security.drawImage.image.sub</title>
<title>Canvas test: security.drawImage.image</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<link rel="stylesheet" href="/common/canvas-tests.css">
<body class="show_output">
<h1>security.drawImage.image.sub</h1>
<h1>security.drawImage.image</h1>
<p class="desc">drawImage of different-origin image makes the canvas origin-unclean</p>
@ -26,5 +26,6 @@ assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
});
</script>
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
<script src="/common/get-host-info.sub.js"></script>
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>

View file

@ -1,13 +1,13 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>Canvas test: security.pattern.canvas.fillStyle.sub</title>
<title>Canvas test: security.pattern.canvas.fillStyle</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<link rel="stylesheet" href="/common/canvas-tests.css">
<body class="show_output">
<h1>security.pattern.canvas.fillStyle.sub</h1>
<h1>security.pattern.canvas.fillStyle</h1>
<p class="desc">Setting fillStyle to a pattern of an unclean canvas makes the canvas origin-unclean</p>
@ -33,5 +33,6 @@ assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
});
</script>
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
<script src="/common/get-host-info.sub.js"></script>
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>

View file

@ -1,13 +1,13 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>Canvas test: security.pattern.canvas.strokeStyle.sub</title>
<title>Canvas test: security.pattern.canvas.strokeStyle</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<link rel="stylesheet" href="/common/canvas-tests.css">
<body class="show_output">
<h1>security.pattern.canvas.strokeStyle.sub</h1>
<h1>security.pattern.canvas.strokeStyle</h1>
<p class="desc">Setting strokeStyle to a pattern of an unclean canvas makes the canvas origin-unclean</p>
@ -33,5 +33,6 @@ assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
});
</script>
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
<script src="/common/get-host-info.sub.js"></script>
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>

View file

@ -1,13 +1,13 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>Canvas test: security.pattern.canvas.timing.sub</title>
<title>Canvas test: security.pattern.canvas.timing</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<link rel="stylesheet" href="/common/canvas-tests.css">
<body class="show_output">
<h1>security.pattern.canvas.timing.sub</h1>
<h1>security.pattern.canvas.timing</h1>
<p class="desc">Pattern safety depends on whether the source was origin-clean, not on whether it still is clean</p>
<p class="notes">Disagrees with spec on "is" vs "was"
@ -36,5 +36,6 @@ _assert(true, "true"); // okay if there was no exception
});
</script>
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
<script src="/common/get-host-info.sub.js"></script>
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>

View file

@ -1,13 +1,13 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>Canvas test: security.pattern.create.sub</title>
<title>Canvas test: security.pattern.create</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<link rel="stylesheet" href="/common/canvas-tests.css">
<body class="show_output">
<h1>security.pattern.create.sub</h1>
<h1>security.pattern.create</h1>
<p class="desc">Creating an unclean pattern does not make the canvas origin-unclean</p>
@ -27,5 +27,6 @@ _assert(true, "true"); // okay if there was no exception
});
</script>
<img src="http://{{domains[www]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
<script src="/common/get-host-info.sub.js"></script>
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>

View file

@ -1,13 +1,13 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>Canvas test: security.pattern.cross.sub</title>
<title>Canvas test: security.pattern.cross</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<link rel="stylesheet" href="/common/canvas-tests.css">
<body class="show_output">
<h1>security.pattern.cross.sub</h1>
<h1>security.pattern.cross</h1>
<p class="desc">Using an unclean pattern makes the target canvas origin-unclean, not the pattern canvas</p>
@ -34,5 +34,6 @@ ctx2.getImageData(0, 0, 1, 1);
});
</script>
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
<script src="/common/get-host-info.sub.js"></script>
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>

View file

@ -1,13 +1,13 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>Canvas test: security.pattern.image.fillStyle.sub</title>
<title>Canvas test: security.pattern.image.fillStyle</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<link rel="stylesheet" href="/common/canvas-tests.css">
<body class="show_output">
<h1>security.pattern.image.fillStyle.sub</h1>
<h1>security.pattern.image.fillStyle</h1>
<p class="desc">Setting fillStyle to a pattern of a different-origin image makes the canvas origin-unclean</p>
@ -28,5 +28,6 @@ assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
});
</script>
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
<script src="/common/get-host-info.sub.js"></script>
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>

View file

@ -1,13 +1,13 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>Canvas test: security.pattern.image.strokeStyle.sub</title>
<title>Canvas test: security.pattern.image.strokeStyle</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<link rel="stylesheet" href="/common/canvas-tests.css">
<body class="show_output">
<h1>security.pattern.image.strokeStyle.sub</h1>
<h1>security.pattern.image.strokeStyle</h1>
<p class="desc">Setting strokeStyle to a pattern of a different-origin image makes the canvas origin-unclean</p>
@ -28,5 +28,6 @@ assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
});
</script>
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
<script src="/common/get-host-info.sub.js"></script>
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>

View file

@ -1,13 +1,13 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>Canvas test: security.reset.sub</title>
<title>Canvas test: security.reset</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<link rel="stylesheet" href="/common/canvas-tests.css">
<body class="show_output">
<h1>security.reset.sub</h1>
<h1>security.reset</h1>
<p class="desc">Resetting the canvas state does not reset the origin-clean flag</p>
@ -28,5 +28,6 @@ assert_throws("SECURITY_ERR", function() { canvas.toDataURL(); });
});
</script>
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
<script src="/common/get-host-info.sub.js"></script>
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>

View file

@ -10,9 +10,8 @@
<div id="log"></div>
<script>
function test_allowfullscreen(t, setup_iframe) {
async_test(function(t) {
var iframe = document.createElement("iframe");
setup_iframe(iframe);
iframe.src = "support/blank.htm";
var eventWatcher = new EventWatcher(t, iframe, "load");
document.body.appendChild(iframe);
@ -21,74 +20,15 @@
});
assert_true(document.fullscreenEnabled, "Top level document has fullscreen enabled flag set");
eventWatcher.wait_for("load").then(t.step_func(function() {
eventWatcher.wait_for("load").then(t.step_func_done(function() {
assert_false(iframe.contentDocument.fullscreenEnabled, "Document inside iframe without allowfullscreen attribute should not have fullscreen enabled flag set");
iframe.setAttribute("allowfullscreen", true);
assert_false(iframe.contentDocument.fullscreenEnabled, "Setting allowfullscreen attribute after document load should not affect fullscreen enabled flag");
iframe.contentWindow.location.reload();
return eventWatcher.wait_for("load");
})).then(t.step_func(function() {
assert_true(iframe.contentDocument.fullscreenEnabled, "Fullscreen enabled flag should be set when a new document is loaded with allowfullscreen attribute present");
assert_true(iframe.contentDocument.fullscreenEnabled, "Fullscreen should be allowed when allowfullscreen attribute is set");
iframe.removeAttribute("allowfullscreen");
assert_true(iframe.contentDocument.fullscreenEnabled, "Removing allowfullscreen attribute should not affect fullscreen enabled flag");
iframe.contentWindow.location.reload();
return eventWatcher.wait_for("load");
})).then(t.step_func_done(function() {
assert_false(iframe.contentDocument.fullscreenEnabled, "Fullscreen enabled flag should be reset when a new document is loaded with allowfullscreen attribute absent");
assert_false(iframe.contentDocument.fullscreenEnabled, "Fullscreen should be denied when allowfullscreen attribute is removed");
}));
}
async_test(function(t) {
test_allowfullscreen(t, function(iframe) {});
}, "iframe-allowfullscreen");
async_test(function(t) {
test_allowfullscreen(t, function(iframe) {
iframe.setAttribute("sandbox", "allow-same-origin");
});
}, "iframe-sandbox-allowfullscreen");
/* Fullscreen enabled flag with dialog */
function test_allowfullscreen_dialog(t, setup_iframe, check) {
var iframe = document.createElement("iframe");
setup_iframe(iframe);
iframe.src = "support/blank.htm";
var eventWatcher = new EventWatcher(t, iframe, "load");
document.body.appendChild(iframe);
t.add_cleanup(function() {
document.body.removeChild(iframe);
});
var newWin;
assert_true(document.fullscreenEnabled, "Top level document has fullscreen enabled flag set");
eventWatcher.wait_for("load").then(t.step_func(function() {
assert_false(iframe.contentDocument.fullscreenEnabled, "Document inside iframe without allowfullscreen attribute should not have fullscreen enabled flag set");
newWin = iframe.contentWindow.open("support/blank.htm");
t.add_cleanup(function() {
newWin.close();
});
var newWinEventWatcher = new EventWatcher(t, newWin, "load");
return newWinEventWatcher.wait_for("load");
})).then(t.step_func_done(function() {
check(newWin);
}));
}
async_test(function(t) {
test_allowfullscreen_dialog(t, function() {}, function(newWin) {
assert_true(newWin.document.fullscreenEnabled, "Document in the new window is a top level document, thus should has fullscreen enabled flag set");
});
}, "iframe-allowfullscreen-dialog");
async_test(function(t) {
test_allowfullscreen_dialog(t, function(iframe) {
iframe.setAttribute("sandbox", "allow-same-origin allow-popups");
}, function(newWin) {
assert_false(newWin.document.fullscreenEnabled, "Document in the new window should inherit the sandboxed fullscreen flag and should not have fullscreen enabled flag set");
});
}, "iframe-sandbox-allowfullscreen-dialog");
/* Fullscreen enabled flag with about:blank */
function test_allowfullscreen_noload(setup_iframe, check) {