Bug 1140286 - Remove CPOW usage from browser_thumbnails_bg_no_cookies_stored.js. r=adw
authorKevin Chan <Kevchan85@yahoo.com>
Tue, 13 Sep 2016 16:32:00 -0400
changeset 357235 181fa71d8b016570d55ce568f03a2ed035f6b3e3
parent 357234 8a996d7c71a2e20e3c01c1f555232f1e3830cee1
child 357236 b532ddbe9b4131f0e2f783405b0a569e67c175e6
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1140286
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 1140286 - Remove CPOW usage from browser_thumbnails_bg_no_cookies_stored.js. r=adw
toolkit/components/thumbnails/test/browser_thumbnails_bg_no_cookies_stored.js
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_cookies_stored.js
+++ b/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_cookies_stored.js
@@ -10,19 +10,20 @@ function* runTests() {
     xhr: bgTestPageURL({ setRedCookie: true})
   });
   ok(!thumbnailExists(url), "Thumbnail file should not exist before capture.");
   yield bgCapture(url);
   ok(thumbnailExists(url), "Thumbnail file should exist after capture.");
   removeThumbnail(url);
   // now load it up in a browser - it should *not* be red, otherwise the
   // cookie above was saved.
-  let tab = gBrowser.loadOneTab(url, { inBackground: false });
+  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url);
   let browser = tab.linkedBrowser;
-  yield whenLoaded(browser);
 
   // The root element of the page shouldn't be red.
-  let redStr = "rgb(255, 0, 0)";
-  isnot(browser.contentDocument.documentElement.style.backgroundColor,
-        redStr,
-        "The page shouldn't be red.");
+  yield ContentTask.spawn(browser, null, function() {
+    Assert.notEqual(content.document.documentElement.style.backgroundColor,
+                    "rgb(255, 0, 0)",
+                    "The page shouldn't be red.");
+  });
+
   gBrowser.removeTab(tab);
 }