Bug 1423959 - Cleanup browser_loadURI.js and re-enable it on all platforms, r=kmag

This ensures that we wait for the desired URL in the browserLoaded call, rather
than resolving the first-loaded one.

This also renames the file to make it more indicative of what it actually tests.

Differential Revision: https://phabricator.services.mozilla.com/D55045

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kashav Madan 2019-11-28 16:13:26 +00:00
Родитель b2f6482e13
Коммит 9d25758002
2 изменённых файлов: 16 добавлений и 18 удалений

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

@ -119,8 +119,7 @@ skip-if = (verify && debug && (os == 'win'))
support-files =
redirect_to_example.sjs
[browser_loadDisallowInherit.js]
[browser_loadURI.js]
skip-if = (os == 'linux') || (os == 'mac') || (os == "win" && bits == 64)# Bug 1423959
[browser_loadURI_postdata.js]
[browser_multiple_pushState.js]
[browser_onbeforeunload_navigation.js]
skip-if = (os == 'win' && !debug) # bug 1300351

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

@ -2,8 +2,10 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
const gPostData = "postdata=true";
const gUrl =
"http://mochi.test:8888/browser/docshell/test/browser/print_postdata.sjs";
function test() {
add_task(async function test_loadURI_persists_postData() {
waitForExplicitFinish();
let tab = (gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser));
@ -25,19 +27,16 @@ function test() {
Ci.nsIPrincipal
);
tab.linkedBrowser.loadURI(
"http://mochi.test:8888/browser/docshell/test/browser/print_postdata.sjs",
{
triggeringPrincipal: systemPrincipal,
postData: postStream,
}
);
BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
ContentTask.spawn(tab.linkedBrowser, gPostData, function(postData) {
var bodyText = content.document.body.textContent;
is(bodyText, postData, "post data was submitted correctly");
}).then(() => {
finish();
});
tab.linkedBrowser.loadURI(gUrl, {
triggeringPrincipal: systemPrincipal,
postData: postStream,
});
}
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, gUrl);
let body = await SpecialPowers.spawn(
tab.linkedBrowser,
[],
() => content.document.body.textContent
);
is(body, gPostData, "post data was submitted correctly");
finish();
});