Bug 1241719 - Fix intermittent browser_ext_tabs_onUpdated.js r=kmag
authorRob Wu <rob@robwu.nl>
Sat, 10 Sep 2016 03:16:39 -0700
changeset 354765 3c226fecfb2c1ec6dcc8cb21cb54139660b66be4
parent 354764 cfdb7af3af2e92e95f71ca2f1672bf5433beeb89
child 354766 3d667f260feb3f7f30fca84f608b92e330aa349c
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1241719
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1241719 - Fix intermittent browser_ext_tabs_onUpdated.js r=kmag MozReview-Commit-ID: LhHS6F0YFUJ
browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js
--- a/browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js
@@ -25,17 +25,21 @@ add_task(function* () {
       let expectedSequence = [
         {status: "loading"},
         {status: "loading", url: pageURL},
         {status: "complete"},
       ];
       let collectedSequence = [];
 
       browser.tabs.onUpdated.addListener(function(tabId, updatedInfo) {
-        collectedSequence.push(updatedInfo);
+        // onUpdated also fires with updatedInfo.faviconUrl, so explicitly
+        // check for updatedInfo.status before recording the event.
+        if ("status" in updatedInfo) {
+          collectedSequence.push(updatedInfo);
+        }
       });
 
       browser.runtime.onMessage.addListener(function() {
         if (collectedSequence.length !== expectedSequence.length) {
           browser.test.assertEq(
             JSON.stringify(expectedSequence),
             JSON.stringify(collectedSequence),
             "got unexpected number of updateInfo data"