Bug 1260714 - Fix intermittent browser_computed_search-filter_clear.js . r=jdescottes draft
authorNicolas Chevobbe <chevobbe.nicolas@gmail.com>
Fri, 01 Apr 2016 17:47:43 +0200
changeset 347110 492fa65a47d6c11219a1385e09837d8bba35c451
parent 345748 e1c798332d3be8aed7b934d2e6b3982d5de7d902
child 517548 fbe4ccae709c1148085e773ff317cc7942225034
push id14493
push userchevobbe.nicolas@gmail.com
push dateFri, 01 Apr 2016 23:00:05 +0000
reviewersjdescottes
bugs1260714
milestone48.0a1
Bug 1260714 - Fix intermittent browser_computed_search-filter_clear.js . r=jdescottes The test used to time out, mainly because we were checking 'Browser styles' on the computed properties panel, which is quite slow. As the 'Browser styles' checkbox is already tested in its own test, we can remove it from here, and adapt this test to take this into account. MozReview-Commit-ID: CR94qfg73DR
devtools/client/inspector/computed/test/browser_computed_search-filter_clear.js
--- a/devtools/client/inspector/computed/test/browser_computed_search-filter_clear.js
+++ b/devtools/client/inspector/computed/test/browser_computed_search-filter_clear.js
@@ -5,16 +5,18 @@
 "use strict";
 
 // Tests that the search filter clear button works properly.
 
 const TEST_URI = `
   <style type="text/css">
     .matches {
       color: #F00;
+      background-color: #00F;
+      border-color: #0F0;
     }
   </style>
   <span id="matches" class="matches">Some styled text</span>
 `;
 
 add_task(function*() {
   yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
   let {inspector, view} = yield openComputedView();
@@ -24,21 +26,16 @@ add_task(function*() {
 });
 
 function* testAddTextInFilter(inspector, computedView) {
   info("Setting filter text to \"background-color\"");
 
   let win = computedView.styleWindow;
   let propertyViews = computedView.propertyViews;
   let searchField = computedView.searchField;
-  let checkbox = computedView.includeBrowserStylesCheckbox;
-
-  info("Include browser styles");
-  checkbox.click();
-  yield inspector.once("computed-view-refreshed");
 
   searchField.focus();
   synthesizeKeys("background-color", win);
   yield inspector.once("computed-view-refreshed");
 
   info("Check that the correct properties are visible");
 
   propertyViews.forEach((propView) => {
@@ -59,13 +56,12 @@ function* testClearSearchFilter(inspecto
 
   EventUtils.synthesizeMouseAtCenter(searchClearButton, {}, win);
   yield onRefreshed;
 
   info("Check that the correct properties are visible");
 
   ok(!searchField.value, "Search filter is cleared");
   propertyViews.forEach((propView) => {
-    let name = propView.name;
-    is(propView.visible, true,
-      "span " + name + " property is visible");
+    is(propView.visible, propView.hasMatchedSelectors,
+      "span " + propView.name + " property visibility check");
   });
 }