Bug 1288213 - Fix and re-enable intermittent layout view tests. r?gl
The reason for the intermittent timeouts wasn't actually in the layoutview but
in the computed view instead. It turns out computed view didn't handle
selection change during an ongoing update from previous selection change
correctly. When layout view was moved to the computed view, it caused more
things to happen during selection change which slowed the computed view
updates triggering this race condition.
Whenever selection changed, the previous update was canceled but the
promise that was blocking the inspector-updated event from being emitted
was never resolved nor rejected. This together with the fact that the
layoutview tests didn't properly wait for the initial update after
navigation / reload to finish before they triggered a new upload lead
to the inspector update to hang waiting for the inspector-updated event
and the test to timeout.
These changes fix the issues by rejecting the computed-view updated promise
whenever the update is canceled. This unblocks the inspector-updated event
to be emitted once the selection change has finished and stops the tests
from timing out.
MozReview-Commit-ID: H4cakxkm4vX
--- a/devtools/client/inspector/computed/computed.js
+++ b/devtools/client/inspector/computed/computed.js
@@ -478,16 +478,19 @@ CssComputedView.prototype = {
this._darkStripe = true;
let deferred = defer();
this._refreshProcess = new UpdateProcess(
this.styleWindow, this.propertyViews, {
onItem: (propView) => {
propView.refresh();
},
+ onCancel: () => {
+ deferred.reject("_refreshProcess of computed view cancelled");
+ },
onDone: () => {
this._refreshProcess = null;
this.noResults.hidden = this.numVisibleProperties > 0;
if (this.searchField.value.length > 0 &&
!this.numVisibleProperties) {
this.searchField.classList
.add("devtools-style-searchbox-no-match");
--- a/devtools/client/inspector/layout/test/browser.ini
+++ b/devtools/client/inspector/layout/test/browser.ini
@@ -18,14 +18,12 @@ support-files =
# Disabled for too many intermittent failures (bug 1009322)
[browser_layout_editablemodel_bluronclick.js]
[browser_layout_editablemodel_border.js]
[browser_layout_editablemodel_stylerules.js]
[browser_layout_guides.js]
[browser_layout_rotate-labels-on-sides.js]
[browser_layout_sync.js]
[browser_layout_tooltips.js]
-# [browser_layout_update-after-navigation.js]
-# Disabled for too many intermittent failures (bug 1288213)
-# [browser_layout_update-after-reload.js]
-# Disabled for too many intermittent failures (bug 1287745)
+[browser_layout_update-after-navigation.js]
+[browser_layout_update-after-reload.js]
# [browser_layout_update-in-iframes.js]
# Bug 1020038 layout-view updates for iframe elements changes