Bug 1140286 - Remove CPOW usage from browser_thumbnails_bg_no_cookies_stored.js. r=adw, a=test-only
authorKevin Chan <Kevchan85@yahoo.com>
Tue, 13 Sep 2016 16:32:00 -0400
changeset 348147 94326655773401f7bb034d8fca8bf607319fe76b
parent 348146 7852ac7e74faf5a637189437ce0a9a7f39e6292c
child 348148 69979d468f59d8f2f1aa475784119ec715ee6bd3
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)
reviewersadw, test-only
bugs1140286
milestone50.0a2
Bug 1140286 - Remove CPOW usage from browser_thumbnails_bg_no_cookies_stored.js. r=adw, a=test-only
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);
 }