Bug 1494162 - Part 19 Follow up: Fix test failures in test_css-logic-getCssPath.html. r=me
authorGabriel Luong <gabriel.luong@gmail.com>
Fri, 28 Sep 2018 16:12:47 -0400
changeset 494564 6297b63aa220eb1f7e062aecdd59c26a32f1a6d8
parent 494563 5fd32a2fbc66ce325be5c3adab70368f20cfce53
child 494565 4a69fe45e0de9deb8127e950d164cf664b2e8475
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1494162
milestone64.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 1494162 - Part 19 Follow up: Fix test failures in test_css-logic-getCssPath.html. r=me
devtools/shared/tests/mochitest/test_css-logic-getCssPath.html
--- a/devtools/shared/tests/mochitest/test_css-logic-getCssPath.html
+++ b/devtools/shared/tests/mochitest/test_css-logic-getCssPath.html
@@ -7,17 +7,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <meta charset="utf-8">
   <title>Test for Bug 1323700</title>
 
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript">
 
 let { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
-const CssLogic = require("devtools/shared/inspector/css-logic");
+const getCssPath = require("resource://gre/modules/css-selector.js");
 
 var _tests = [];
 function addTest(test) {
   _tests.push(test);
 }
 
 function runNextTest() {
   if (_tests.length == 0) {
@@ -30,31 +30,31 @@ function runNextTest() {
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
 }
 
 addTest(function getCssPathForUnattachedElement() {
   var unattached = document.createElement("div");
   unattached.id = "unattached";
-  is(CssLogic.getCssPath(unattached), "", "Unattached node returns empty string");
+  is(getCssPath(unattached), "", "Unattached node returns empty string");
 
   var unattachedChild = document.createElement("div");
   unattached.appendChild(unattachedChild);
-  is(CssLogic.getCssPath(unattachedChild), "", "Unattached child returns empty string");
+  is(getCssPath(unattachedChild), "", "Unattached child returns empty string");
 
   var unattachedBody = document.createElement("body");
-  is(CssLogic.getCssPath(unattachedBody), "", "Unattached body returns empty string");
+  is(getCssPath(unattachedBody), "", "Unattached body returns empty string");
 
   runNextTest();
 });
 
 addTest(function cssPathHasOneStepForEachAncestor() {
   for (let el of [...document.querySelectorAll('*')]) {
-    let splitPath = CssLogic.getCssPath(el).split(" ");
+    let splitPath = getCssPath(el).split(" ");
 
     let expectedNbOfParts = 0;
     var parent = el.parentNode;
     while (parent) {
       expectedNbOfParts ++;
       parent = parent.parentNode;
     }
 
@@ -79,17 +79,17 @@ addTest(function getCssPath() {
     path: "html body span.c1.c2.c3"
   }, {
     selector: "#i",
     path: "html body span#i.c1.c2"
   }];
 
   for (let {selector, path} of data) {
     let node = document.querySelector(selector);
-    is (CssLogic.getCssPath(node), path, `Full css path is correct for ${selector}`);
+    is (getCssPath(node), path, `Full css path is correct for ${selector}`);
   }
 
   runNextTest();
 });
   </script>
 </head>
 <body>
   <div>