Bug 1384162 part 4 - Add test to ensure that blank document uses the same backend as its parent document and update test expectation. r?bz draft
authorXidorn Quan <me@upsuper.org>
Wed, 26 Jul 2017 20:03:39 +1000
changeset 616306 0fab994aaebb13f3f1cf86d6b390536656a111ff
parent 616305 f6b2f32fb4e7b3cb1022d1fef0722435d25d0d46
child 639433 d083385ee451614aaf51768618df592342b3963e
push id70642
push userxquan@mozilla.com
push dateWed, 26 Jul 2017 22:23:16 +0000
reviewersbz
bugs1384162
milestone56.0a1
Bug 1384162 part 4 - Add test to ensure that blank document uses the same backend as its parent document and update test expectation. r?bz MozReview-Commit-ID: 3rBCCbtW3J1
layout/style/test/file_blank_doc_backend.html
layout/style/test/mochitest.ini
layout/style/test/test_blank_doc_backend.html
new file mode 100644
--- /dev/null
+++ b/layout/style/test/file_blank_doc_backend.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<iframe></iframe>
+<script>
+let iframe = document.querySelector("iframe");
+iframe.contentDocument.writeln("<style></style>");
+iframe.contentDocument.close();
+opener.finish(window, iframe.contentWindow);
+</script>
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -73,16 +73,18 @@ support-files = file_animations_reverse.
 support-files = file_animations_styles_on_event.html
 [test_animations_with_disabled_properties.html]
 support-files = file_animations_with_disabled_properties.html
 [test_any_dynamic.html]
 [test_asyncopen2.html]
 [test_at_rule_parse_serialize.html]
 [test_attribute_selector_eof_behavior.html]
 [test_background_blend_mode.html]
+[test_blank_doc_backend.html]
+support-files = file_blank_doc_backend.html
 [test_box_size_keywords.html]
 [test_bug73586.html]
 [test_bug74880.html]
 [test_bug98997.html]
 [test_bug160403.html]
 [test_bug200089.html]
 [test_bug221428.html]
 [test_bug229915.html]
@@ -331,9 +333,9 @@ skip-if = toolkit == 'android' # TIMED_O
 [test_visited_pref.html]
 skip-if = toolkit == 'android' # TIMED_OUT for android
 [test_visited_reftests.html]
 skip-if = toolkit == 'android' # TIMED_OUT for android
 [test_webkit_device_pixel_ratio.html]
 [test_webkit_flex_display.html]
 [test_first_letter_restrictions.html]
 [test_first_line_restrictions.html]
-[test_placeholder_restrictions.html]
\ No newline at end of file
+[test_placeholder_restrictions.html]
new file mode 100644
--- /dev/null
+++ b/layout/style/test/test_blank_doc_backend.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Test backend of blank document</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<iframe></iframe>
+<pre id="log">
+<script>
+SimpleTest.waitForExplicitFinish();
+let win = window.open("file_blank_doc_backend.html", "", "width=500,height=500");
+function finish(parentWin, iframeWin) {
+  let parentDOMUtils = SpecialPowers.getDOMWindowUtils(parentWin);
+  let iframeDOMUtils = SpecialPowers.getDOMWindowUtils(iframeWin);
+  is(parentDOMUtils.isStyledByServo, iframeDOMUtils.isStyledByServo,
+     "Blank document backend should match the parent document");
+  win.close();
+  SimpleTest.finish();
+};
+</script>
+</pre>
+</body>
+</html>