Bug 1308526 - fix waiting for the test page to load before trying to use it, r?baku draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 03 Jan 2017 11:49:33 +0000
changeset 455276 aa4f25faeca779ba635774dc24c1d26ce394bdac
parent 455176 c91249f41e3766274131a84f9157a4d9d9949520
child 540940 92386a77432c2e19dba6486b690efe463664ecda
push id40185
push usergijskruitbosch@gmail.com
push dateTue, 03 Jan 2017 11:50:08 +0000
reviewersbaku
bugs1308526
milestone53.0a1
Bug 1308526 - fix waiting for the test page to load before trying to use it, r?baku MozReview-Commit-ID: GgafFr5ggGa
dom/base/test/browser_bug1307747.js
--- a/dom/base/test/browser_bug1307747.js
+++ b/dom/base/test/browser_bug1307747.js
@@ -1,16 +1,16 @@
 /* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
 
 var {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 const BASE_URI = "http://mochi.test:8888/browser/dom/base/test/empty.html";
 
 add_task(function* test_initialize() {
-  let tab = gBrowser.addTab(BASE_URI);
+  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser = gBrowser.getBrowserForTab(tab);
 
   let blob = yield ContentTask.spawn(browser, null, function() {
     let blob = new Blob([new Array(1024*1024).join('123456789ABCDEF')]);
     return blob;
   });
 
   ok(blob, "We have a blob!");