зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1607984 - P6. Fix test. r=MattN
Following the changes to DocumentChannel the test was failing. With DC, a load may take a few event loops to start. This current test was only waiting for the load to start to the URL about:preferences#privacy-logins and would immediately tear down the window. However, this URL redirects to about:preferences#privacy ; destroying the window midway could cause XML parsing error. So now we wait for the page to fully load, and make sure we've been through both addresses. Differential Revision: https://phabricator.services.mozilla.com/D70003 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
69ca0e9e57
Коммит
fbbf9522c0
|
@ -12,9 +12,28 @@ add_task(async function setup() {
|
|||
});
|
||||
|
||||
add_task(async function test_open_preferences() {
|
||||
// We want to make sure we visit about:preferences#privacy-logins , as that is
|
||||
// what causes us to scroll to and highlight the "logins" section. However,
|
||||
// about:preferences will redirect the URL, so the eventual load event will happen
|
||||
// on about:preferences#privacy . The `wantLoad` parameter we pass to
|
||||
// `waitForNewTab` needs to take this into account:
|
||||
let seenFirstURL = false;
|
||||
let promiseNewTab = BrowserTestUtils.waitForNewTab(
|
||||
gBrowser,
|
||||
"about:preferences#privacy-logins"
|
||||
url => {
|
||||
if (url == "about:preferences#privacy-logins") {
|
||||
seenFirstURL = true;
|
||||
return true;
|
||||
} else if (url == "about:preferences#privacy") {
|
||||
ok(
|
||||
seenFirstURL,
|
||||
"Must have seen an onLocationChange notification for the privacy-logins hash"
|
||||
);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
|
|
Загрузка…
Ссылка в новой задаче