Bug 1241719 - Fix intermittent browser_ext_tabs_onUpdated.js. r=kmag, a=test-only
authorRob Wu <rob@robwu.nl>
Sat, 10 Sep 2016 03:16:39 -0700
changeset 348215 7d67edce5ec0e4b137bee04c5931605f1eb70027
parent 348214 79adb317eca45959afcdb2eb5291a5fbd569b598
child 348216 0437e13b60c39116f82158dfc77c3f72436100f2
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, test-only
bugs1241719
milestone50.0a2
Bug 1241719 - Fix intermittent browser_ext_tabs_onUpdated.js. r=kmag, a=test-only 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"