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
--- 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");
});
}