mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update web-platform-tests to revision 7da6acfd668e66adae5ab4e2d389810d3b1460be
This commit is contained in:
parent
50db64a20e
commit
bae87d193d
307 changed files with 35826 additions and 209 deletions
|
@ -0,0 +1,51 @@
|
|||
<!doctype html>
|
||||
<title>window.length</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
var iframe;
|
||||
var subframe;
|
||||
var other_window;
|
||||
test(function() {assert_equals(window.length, 0)}, "No child browsing contexts");
|
||||
test(function() {
|
||||
iframe = document.createElement("iframe");
|
||||
assert_equals(window.length, 0)
|
||||
}, "iframe not inserted into the document");
|
||||
|
||||
test(function() {
|
||||
document.body.appendChild(iframe);
|
||||
assert_equals(window.length, 1)
|
||||
}, "One iframe inserted into the document");
|
||||
|
||||
test(function() {
|
||||
subframe = document.createElement("iframe");
|
||||
iframe.contentDocument.body.appendChild(subframe);
|
||||
assert_equals(window.length, 1);
|
||||
}, "Child browsing context has a child browsing context");
|
||||
|
||||
test(function() {
|
||||
try {
|
||||
assert_equals(iframe.contentWindow.length, 1);
|
||||
} finally {
|
||||
subframe.parentNode.removeChild(subframe);
|
||||
}
|
||||
}, "window.length in child frame");
|
||||
|
||||
test(function() {
|
||||
iframe.parentNode.removeChild(iframe);
|
||||
other_window = window.open();
|
||||
assert_equals(window.length, 0);
|
||||
assert_equals(other_window.length, 0);
|
||||
}, "Opened window")
|
||||
|
||||
test(function() {
|
||||
other_window.document.body.appendChild(iframe);
|
||||
try {
|
||||
assert_equals(other_window.length, 1);
|
||||
} finally {
|
||||
other_window.close();
|
||||
}
|
||||
}, "Iframe in opened window")
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue