Bug 1452143: Fix dom / style tests. r=bholley
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 16 Apr 2018 16:40:15 +0200
changeset 414084 20b1c2e6fceba63ebb758cb6b8d9659cf7466631
parent 414083 7b130a4f638a17f5cea2aec8abd14e48aee67d86
child 414085 40a157e04cbc852d7292bb0a016a2b428a6d0e05
push id33858
push userncsoregi@mozilla.com
push dateTue, 17 Apr 2018 21:55:44 +0000
treeherdermozilla-central@d6eb5597d744 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1452143
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1452143: Fix dom / style tests. r=bholley MozReview-Commit-ID: 95JfwBVDdRD
dom/base/test/test_bug513194.html
layout/style/test/test_bug413958.html
layout/style/test/test_css_parse_error_smoketest.html
--- a/dom/base/test/test_bug513194.html
+++ b/dom/base/test/test_bug513194.html
@@ -12,17 +12,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <body>
 <a target="_blank"
    href="https://bugzilla.mozilla.org/show_bug.cgi?id=631615"
    >Mozilla Bug 513194</a>
 <script>
 // The use of document.write is deliberate.  We are testing for the
 // HTML parser to call the CSS parser once and only once when it
 // encounters a new <style> element.
-
+SpecialPowers.wrap(document).docShell.cssErrorReportingEnabled = true;
 SimpleTest.runTestExpectingConsoleMessages(
   function () { document.write("<style>qux { foo : bar; }<\/style>") },
   [{ errorMessage: /Unknown property/ }]
 );
 </script>
 </body>
 </html>
 
--- a/layout/style/test/test_bug413958.html
+++ b/layout/style/test/test_bug413958.html
@@ -15,16 +15,18 @@ https://bugzilla.mozilla.org/show_bug.cg
       href="https://bugzilla.mozilla.org/show_bug.cgi?id=413958"
       >Mozilla Bug 413958</a>. All text below should be black on white.</p>
 <p>Sheet: <span id="s1">1</span>
           <span id="s2">2</span>
           <span id="s3">3</span>.
    Style attr: <span id="setStyle">4</span>.
    Properties: <span id="setStyleProp" style="">5</span>.</p>
 <script>
+SpecialPowers.wrap(document).docShell.cssErrorReportingEnabled = true;
+
 var tests = [
   function() {
     var s = document.createTextNode(
 "#s1{nosuchprop:auto; color:black}\n"+
 "#s2{nosuchprop:auto; color:black}invalid?sel{}#s3{color:black}"),
         e = document.createElement("style");
     e.appendChild(s);
     document.body.appendChild(e);
@@ -34,33 +36,27 @@ var tests = [
             .setAttribute("style", "width:200;color:black");
   },
   function() {
     var s = document.getElementById("setStyleProp").style;
     s.width = "200";
     s.color = "black";
   },
 ];
-const isStylo = SpecialPowers.DOMWindowUtils.isStyledByServo;
 var results = [
   [ { errorMessage: /Unknown property \u2018nosuchprop\u2019/,
-      lineNumber: 1, columnNumber: isStylo ? 16 : 14,
-      sourceLine: isStylo ? "" : "#s1{nosuchprop:auto; color:black}" },
+      lineNumber: 1, columnNumber: 16, sourceLine: "" },
     { errorMessage: /Unknown property \u2018nosuchprop\u2019/,
-      lineNumber: 2, columnNumber: isStylo ? 16 : 14, sourceLine:
-      isStylo ? "" : "#s2{nosuchprop:auto; color:black}invalid?sel{}#s3{color:black}" },
+      lineNumber: 2, columnNumber: 16, sourceLine: "" },
     { errorMessage: /Ruleset ignored due to bad selector/,
-      lineNumber: 2, columnNumber: isStylo ? 41 : 40, sourceLine:
-      isStylo ? "" : "#s2{nosuchprop:auto; color:black}invalid?sel{}#s3{color:black}" } ],
+      lineNumber: 2, columnNumber: 41, sourceLine: "" } ],
   [ { errorMessage: /parsing value for \u2018width\u2019/,
-      lineNumber: 0, columnNumber: isStylo ? 7 : 6,
-      sourceLine: isStylo ? "" : "width:200;color:black" } ],
+      lineNumber: 0, columnNumber: 7, sourceLine: "" } ],
   [ { errorMessage: /parsing value for \u2018width\u2019/,
-      lineNumber: 0, columnNumber: isStylo ? 1 : 0,
-      sourceLine: isStylo ? "" : "200" } ],
+      lineNumber: 0, columnNumber: 1, sourceLine: "" } ],
 ];
 var curTest = -1;
 
 function doTest() {
   if (++curTest == tests.length) {
     var ss = document.getElementsByTagName("span");
     for (var i = 0; i < ss.length; i++) {
       is(window.getComputedStyle(ss[i]).color, "rgb(0, 0, 0)",
--- a/layout/style/test/test_css_parse_error_smoketest.html
+++ b/layout/style/test/test_css_parse_error_smoketest.html
@@ -4,16 +4,17 @@
   <meta charset="utf-8">
   <title>Test for CSS parser reporting parsing errors with expected precision</title>
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css">
 </head>
 <body>
 <style id="testbench"></style>
 <script>
+  SpecialPowers.wrap(document).docShell.cssErrorReportingEnabled = true;
   var tests = [
     { css: "@unknown {}", error: "Unrecognized at-rule or error parsing at-rule ‘@unknown’." },
 
     { css: "x { color: invalid; }", error: "Expected color but found ‘invalid’.  Error in parsing value for ‘color’.  Declaration dropped." },
 
     { css: "x { filter: alpha(foo); }", error: "Expected ‘none’, URL, or filter function but found ‘alpha(’.  Error in parsing value for ‘filter’.  Declaration dropped." },
     { css: "x { filter: 5; }", error: "Expected ‘none’, URL, or filter function but found ‘5’.  Error in parsing value for ‘filter’.  Declaration dropped." },