Bug 1330822 - Remove CPOWs from browser_favicon_change.js. r=Felipe
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 15 Nov 2016 15:11:13 -0800
changeset 374997 32713b1df8ae59b9302fdb4e9b246854261db627
parent 374996 2b01eae261ba9aa94af6884d2e08e00617d2c65e
child 374998 538aec2ed89e8e70ffbf9488e83a54f80d4443a3
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1330822
milestone53.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 1330822 - Remove CPOWs from browser_favicon_change.js. r=Felipe
browser/base/content/test/general/browser_favicon_change.js
--- a/browser/base/content/test/general/browser_favicon_change.js
+++ b/browser/base/content/test/general/browser_favicon_change.js
@@ -2,18 +2,18 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_favicon_change.html"
 
 add_task(function*() {
   let extraTab = gBrowser.selectedTab = gBrowser.addTab();
-  let tabLoaded = promiseTabLoaded(extraTab);
   extraTab.linkedBrowser.loadURI(TEST_URL);
+  let tabLoaded = BrowserTestUtils.browserLoaded(extraTab.linkedBrowser);
   let expectedFavicon = "http://example.org/one-icon";
   let haveChanged = new Promise.defer();
   let observer = new MutationObserver(function(mutations) {
     for (let mut of mutations) {
       if (mut.attributeName != "image") {
         continue;
       }
       let imageVal = extraTab.getAttribute("image").replace(/#.*$/, "");
@@ -25,16 +25,17 @@ add_task(function*() {
       haveChanged.resolve();
     }
   });
   observer.observe(extraTab, {attributes: true});
   yield tabLoaded;
   yield haveChanged.promise;
   haveChanged = new Promise.defer();
   expectedFavicon = "http://example.org/other-icon";
-  let contentWin = extraTab.linkedBrowser.contentWindow;
-  let ev = new contentWin.CustomEvent("PleaseChangeFavicon", {});
-  contentWin.dispatchEvent(ev);
+  ContentTask.spawn(extraTab.linkedBrowser, null, function() {
+    let ev = new content.CustomEvent("PleaseChangeFavicon", {});
+    content.dispatchEvent(ev);
+  });
   yield haveChanged.promise;
   observer.disconnect();
   gBrowser.removeTab(extraTab);
 });