Bug 1260714 - Fix intermittent browser_computed_search-filter_clear.js. r=jdescottes
authorNicolas Chevobbe <chevobbe.nicolas@gmail.com>
Fri, 01 Apr 2016 17:47:43 +0200
changeset 291475 bf1bd53f98ad3235d62a4abd188b3cbb1afa74c9
parent 291473 48b57a7cf7472db5cda6806937b92882cf37042a
child 291476 0cdbbf26ef7feca6f0059efa61952bedbaf9e8aa
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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");
   });
 }