Bug 1262710 - Don't use CPOW in devtools/server/test/browser tests when adding a tab; r=ochameau

MozReview-Commit-ID: DFJvufMBTjn

--HG--
extra : rebase_source : 1366bc929067f6c7bbd5f944f973101bf3af9d7c
This commit is contained in:
Patrick Brosset 2016-06-08 09:47:02 +02:00
parent 6b557997b2
commit 23a6760a0b

View File

@ -31,19 +31,11 @@ waitForExplicitFinish();
* and Promises cannot be resolved with CPOWs (see bug 1233497).
*/
var addTab = Task.async(function* (url) {
info("Adding a new tab with URL: '" + url + "'");
let tab = gBrowser.selectedTab = gBrowser.addTab();
let loaded = once(gBrowser.selectedBrowser, "load", true);
info(`Adding a new tab with URL: ${url}`);
let tab = gBrowser.selectedTab = gBrowser.addTab(url);
yield once(gBrowser.selectedBrowser, "load", true);
content.location = url;
yield loaded;
info("URL '" + url + "' loading complete");
yield new Promise(resolve => {
let isBlank = url == "about:blank";
waitForFocus(resolve, content, isBlank);
});
info(`Tab added and URL ${url} loaded`);
return tab.linkedBrowser;
});