Bug 1374741 - Within browser/ tests make openUILinkIn() provide the correct triggeringPrincipal. r=gijs

MozReview-Commit-ID: 9tJ0b056yNE

--HG--
extra : rebase_source : 6b6c807dc592be347d3e53d700b3ae1fbdc37452
This commit is contained in:
Jonathan Kingston 2018-02-21 14:49:24 +00:00
Родитель ff73ac0338
Коммит d603d359f4
5 изменённых файлов: 12 добавлений и 8 удалений

Просмотреть файл

@ -11,13 +11,13 @@ function test() {
gBrowser.pinTab(newTab);
gBrowser.selectedTab = newTab;
openUILinkIn("javascript:var x=0;", "current");
openTrustedLinkIn("javascript:var x=0;", "current");
is(gBrowser.tabs.length, 2, "Should open in current tab");
openUILinkIn("http://example.com/1", "current");
openTrustedLinkIn("http://example.com/1", "current");
is(gBrowser.tabs.length, 2, "Should open in current tab");
openUILinkIn("http://example.org/", "current");
openTrustedLinkIn("http://example.org/", "current");
is(gBrowser.tabs.length, 3, "Should open in new tab");
gBrowser.removeTab(newTab);

Просмотреть файл

@ -11,7 +11,9 @@ function test() {
gBrowser.pinTab(newTab);
gBrowser.selectedTab = newTab;
openUILinkIn("http://example.org/", "current", { inBackground: true });
openTrustedLinkIn("http://example.org/", "current", {
inBackground: true,
});
isnot(gBrowser.selectedTab, newTab, "shouldn't load in background");
gBrowser.removeTab(newTab);

Просмотреть файл

@ -716,7 +716,7 @@ async function promiseTab() {
deferred.resolve(msg("init"));
});
}, true, true);
openUILinkIn(pageURL, "current");
openTrustedLinkIn(pageURL, "current");
return deferred.promise;
}

Просмотреть файл

@ -38,8 +38,10 @@ add_task(async function test_remoteWebNavigation_postdata() {
"\r\n" +
"success";
openUILinkIn(path, "tab", null, makeInputStream(postdata));
openTrustedLinkIn(path, "tab", {
allowThirdPartyFixup: null,
postData: makeInputStream(postdata),
});
});
BrowserTestUtils.removeTab(gBrowser.selectedTab);

Просмотреть файл

@ -186,7 +186,7 @@ const PROBE_TESTS = [
prepare(browser) {},
async doAction(browser) {
openUILinkIn(PAGE_2, "current");
openTrustedLinkIn(PAGE_2, "current");
await BrowserTestUtils.browserLoaded(browser);
},
},