Bug 1396066: Fix bug 418986 tests. r=me
☠☠ backed out by 4279ffa1e0da ☠ ☠
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 06 Oct 2017 16:52:27 +0200
changeset 384917 635746c88630e076d65e5db3347f6cb77e8433a5
parent 384916 330fc30dc2b0c64c34f3d364d6fe25a3ca0132e3
child 384918 ed95eea7105cbd422cc0e4c128ca232148843106
push id95880
push userarchaeopteryx@coole-files.de
push dateSat, 07 Oct 2017 08:58:44 +0000
treeherdermozilla-inbound@156942799371 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1396066, 418986
milestone58.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 1396066: Fix bug 418986 tests. r=me On a CLOSED TREE. MozReview-Commit-ID: 9bulxAwhsTM
layout/style/test/chrome/bug418986-2.js
--- a/layout/style/test/chrome/bug418986-2.js
+++ b/layout/style/test/chrome/bug418986-2.js
@@ -190,25 +190,30 @@ var suppressedMediaQueryCSSLine = functi
 };
 
 // __generateCSSLines(resisting)__.
 // Creates a series of lines of CSS, each of which corresponds to
 // a different media query. If the query produces a match to the
 // expected value, then the element will be colored green.
 var generateCSSLines = function (resisting) {
   let lines = ".spoof { background-color: red;}\n";
+  let is_chrome_window = window.location.protocol === "chrome:";
   expected_values.forEach(
     function ([key, offVal, onVal]) {
       lines += mediaQueryCSSLine(key, resisting ? onVal : offVal, "green");
     });
   lines += ".suppress { background-color: " + (resisting ? "green" : "red") + ";}\n";
   suppressed_toggles.forEach(
     function (key) {
-      let color = resisting ? "red" : "green";
-      lines += suppressedMediaQueryCSSLine(key, color);
+      if (toggles_enabled_in_content.indexOf(key) === -1 && !resisting && !is_chrome_window) {
+        lines += "#" + key + " { background-color: green; }\n";
+      } else {
+        let color = resisting ? "red" : "green";
+        lines += suppressedMediaQueryCSSLine(key, color);
+      }
     });
   if (OS === "WINNT") {
     lines += ".windows { background-color: green; }\n";
     lines += windows_versions.map(val => "(-moz-os-version: " + val + ")").join(", ") +
              " { #-moz-os-version { background-color: red; } }\n";
     lines += windows_themes.map(val => "(-moz-windows-theme: " + val + ")").join(",") +
              " { #-moz-windows-theme { background-color: red; }\n";
   }