diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-05 22:03:24 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-05 22:03:24 +0530 |
commit | 04600458e662fa32568ad109e4a85e2808693a09 (patch) | |
tree | 31c14f107927a8eb79991b48d9bad7a3adfcb276 | |
parent | 0ff8adb09778402e88fe0d0ad92f4b399ca8ca01 (diff) | |
parent | 5fc5891e04db124df42ace2ddea09d56f196d950 (diff) | |
download | servo-04600458e662fa32568ad109e4a85e2808693a09.tar.gz servo-04600458e662fa32568ad109e4a85e2808693a09.zip |
Auto merge of #10411 - servo:scrollingElement, r=emilio
Rewrite scrollingElement.html to fail reliably when URL.createObjectURL is not implemented.
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10411)
<!-- Reviewable:end -->
-rw-r--r-- | tests/wpt/metadata/cssom-view/scrollingElement.html.ini | 5 | ||||
-rw-r--r-- | tests/wpt/web-platform-tests/cssom-view/scrollingElement.html | 46 |
2 files changed, 21 insertions, 30 deletions
diff --git a/tests/wpt/metadata/cssom-view/scrollingElement.html.ini b/tests/wpt/metadata/cssom-view/scrollingElement.html.ini index 8719b06550b..612c10b6c16 100644 --- a/tests/wpt/metadata/cssom-view/scrollingElement.html.ini +++ b/tests/wpt/metadata/cssom-view/scrollingElement.html.ini @@ -1,5 +1,8 @@ [scrollingElement.html] type: testharness - [Tests for scrollingElement] + [scrollingElement in quirks mode] + expected: FAIL + + [scrollingElement in no-quirks mode] expected: FAIL diff --git a/tests/wpt/web-platform-tests/cssom-view/scrollingElement.html b/tests/wpt/web-platform-tests/cssom-view/scrollingElement.html index 57ca450220d..abede49cf2c 100644 --- a/tests/wpt/web-platform-tests/cssom-view/scrollingElement.html +++ b/tests/wpt/web-platform-tests/cssom-view/scrollingElement.html @@ -7,34 +7,12 @@ <iframe id="nonquirksframe"></iframe> <div id="log"></div> <script> - -var quirksFrame; -var nonQuirksFrame; - -function loadTestFrames(callback) { - quirksFrame = document.getElementById("quirksframe"); - quirksFrame.onload = function() { - nonQuirksFrame = document.getElementById("nonquirksframe"); - nonQuirksFrame.onload = callback; - nonQuirksFrame.src = - URL.createObjectURL(new Blob(["<!doctype html>"], { type: "text/html" })); - } - quirksFrame.src = - URL.createObjectURL(new Blob([""], { type: "text/html" })); -} - -var test = async_test("Tests for scrollingElement"); -loadTestFrames(function() { - test.step(function() { +async_test(function() { + var quirksFrame = document.getElementById("quirksframe"); + quirksFrame.onload = this.step_func(function() { var quirksDoc = quirksFrame.contentDocument; - var nonQuirksDoc = nonQuirksFrame.contentDocument; - - // Initial checks that we have the expected kinds of documents. assert_equals(quirksDoc.compatMode, "BackCompat", "Should be in quirks mode."); - assert_equals(nonQuirksDoc.compatMode, "CSS1Compat", "Should be in standards mode."); - assert_not_equals(quirksDoc.body, null, "Should have a body element"); - assert_not_equals(nonQuirksDoc.body, null, "Should have a body element"); // Tests for quirks mode document. assert_equals(quirksDoc.scrollingElement, quirksDoc.body, @@ -78,8 +56,18 @@ loadTestFrames(function() { quirksDoc.removeChild(quirksDoc.documentElement); quirksDoc.appendChild(quirksDoc.createElement("body")); assert_equals(quirksDoc.scrollingElement, null); + }); + quirksFrame.src = + URL.createObjectURL(new Blob([""], { type: "text/html" })); +}, "scrollingElement in quirks mode"); + +async_test(function() { + var nonQuirksFrame = document.getElementById("nonquirksframe"); + nonQuirksFrame.onload = this.step_func_done(function() { + var nonQuirksDoc = nonQuirksFrame.contentDocument; + assert_equals(nonQuirksDoc.compatMode, "CSS1Compat", "Should be in standards mode."); + assert_not_equals(nonQuirksDoc.body, null, "Should have a body element"); - // Tests for standards mode document. assert_equals(nonQuirksDoc.scrollingElement, nonQuirksDoc.documentElement, "scrollingElement in standards mode should be the document element."); nonQuirksDoc.documentElement.style.overflow = "scroll"; @@ -90,8 +78,8 @@ loadTestFrames(function() { assert_equals(nonQuirksDoc.scrollingElement, null); nonQuirksDoc.appendChild(nonQuirksDoc.createElement("foobar")); assert_equals(nonQuirksDoc.scrollingElement.localName, "foobar"); - }); - test.done(); -}); + nonQuirksFrame.src = + URL.createObjectURL(new Blob(["<!doctype html>"], { type: "text/html" })); +}, "scrollingElement in no-quirks mode"); </script> |