Bug 1311197 - Remove CPOWs from browser_bug655270.js. r=Gijs
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 18 Oct 2016 13:59:06 -0700
changeset 351634 d30948200f1867b97e669bc7d5592dc51532cf0a
parent 351633 fbd597046674eae52e0dcfefb725070794682858
child 351635 eb3c939c1c2245dc88f84ad88a434f287d096008
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1311197, 655270
milestone52.0a1
Bug 1311197 - Remove CPOWs from browser_bug655270.js. r=Gijs MozReview-Commit-ID: 1GuTsuHMd6g
docshell/test/browser/browser_bug655270.js
--- a/docshell/test/browser/browser_bug655270.js
+++ b/docshell/test/browser/browser_bug655270.js
@@ -26,17 +26,21 @@ function test() {
 
   let observer = {
     onPageChanged: function(aURI, aWhat, aValue) {
       if (aWhat != Ci.nsINavHistoryObserver.ATTRIBUTE_FAVICON)
         return;
 
       if (aURI.spec == origURL) {
         is(aValue, faviconURL, 'FaviconURL for original URI');
-        tab.linkedBrowser.contentWindow.history.pushState('', '', '?new_page');
+        // Ignore the promise returned here and wait for the next
+        // onPageChanged notification.
+        ContentTask.spawn(tab.linkedBrowser, null, function() {
+          content.history.pushState('', '', '?new_page');
+        });
       }
 
       if (aURI.spec == newURL) {
         is(aValue, faviconURL, 'FaviconURL for new URI');
         gBrowser.removeTab(tab);
         PlacesUtils.history.removeObserver(this);
         finish();
       }