Bug 1140286 - Remove CPOW usage from browser_thumbnails_bg_no_cookies_stored.js. r=adw
☠☠ backed out by 4850895eb2fb ☠ ☠
authorKevin Chan <Kevchan85@yahoo.com>
Mon, 12 Sep 2016 15:19:00 -0400
changeset 339302 124402b3d83398f66112b34dfb6085fb41bc5a52
parent 339301 8267ed3c552a0be430c4016dd4c86bb8d178f6ab
child 339303 1f293c131736fe5e9ce86c27954ca9364a9a6a6d
push id10033
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:50:26 +0000
treeherdermozilla-aurora@5dddbefdf759 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1140286
milestone51.0a1
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.openNewForgroundTab(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);
 }