Bug 1260199 - Remove yet another use of CPOWs in this test. r=mconley draft
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 13 Sep 2016 16:30:52 -0700
changeset 413294 7aa1d44332716603bbfb6f0a872a34ade3d1e932
parent 413053 f5d043ce6d36a3c461cbd829d4a4a38394b7c436
child 531197 bf3ae7ee80f593190eebe72af1a0e5a567206539
push id29398
push userbmo:mrbkap@mozilla.com
push dateTue, 13 Sep 2016 23:31:16 +0000
reviewersmconley
bugs1260199
milestone51.0a1
Bug 1260199 - Remove yet another use of CPOWs in this test. r=mconley MozReview-Commit-ID: RxKqmcl0aC
browser/base/content/test/general/browser_bookmark_titles.js
--- a/browser/base/content/test/general/browser_bookmark_titles.js
+++ b/browser/base/content/test/general/browser_bookmark_titles.js
@@ -24,17 +24,17 @@ add_task(function* () {
     let browser = gBrowser.selectedBrowser;
     browser.stop(); // stop the about:blank load.
 
     // Test that a bookmark of each URI gets the corresponding default title.
     for (let i = 0; i < tests.length; ++i) {
         let [uri, title] = tests[i];
 
         let promiseLoaded = promisePageLoaded(browser);
-        content.location = uri;
+        BrowserTestUtils.loadURI(browser, uri);
         yield promiseLoaded;
         yield checkBookmark(uri, title);
     }
 
     // Network failure test: now that dummy_page.html is in history, bookmarking
     // it should give the last known page title as the default bookmark title.
 
     // Simulate a network outage with offline mode. (Localhost is still
@@ -48,22 +48,24 @@ add_task(function* () {
     });
 
     // LOAD_FLAGS_BYPASS_CACHE isn't good enough. So clear the cache.
     Services.cache2.clear();
 
     let [uri, title] = tests[0];
 
     let promiseLoaded = promisePageLoaded(browser);
-    content.location = uri;
+    BrowserTestUtils.loadURI(browser, uri);
     yield promiseLoaded;
 
     // The offline mode test is only good if the page failed to load.
-    is(content.document.documentURI.substring(0, 14), 'about:neterror',
-        "Offline mode successfully simulated network outage.");
+    yield ContentTask.spawn(browser, null, function() {
+      is(content.document.documentURI.substring(0, 14), 'about:neterror',
+          "Offline mode successfully simulated network outage.");
+    });
     yield checkBookmark(uri, title);
 
     gBrowser.removeCurrentTab();
 });
 
 // Bookmark the current page and confirm that the new bookmark has the expected
 // title. (Then delete the bookmark.)
 function* checkBookmark(uri, expected_title) {