Bug 1288213 - Fix and re-enable intermittent layout view tests. r=gl
authorSami Jaktholm <sjakthol@outlook.com>
Thu, 11 Aug 2016 18:41:01 +0300
changeset 400789 9e8fb23fc565df8b8f002941e7dc12bced5df054
parent 400788 a11a0035c85e643cf68ed03cd9c6a540367c0756
child 400790 39cd9b527d38af339390f5a7d9c522facf5f3b99
push id26284
push usermwein@mozilla.com
push dateMon, 15 Aug 2016 20:48:20 +0000
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) => {
+          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) {
--- 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_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-in-iframes.js]
 # Bug 1020038 layout-view updates for iframe elements changes