Bug 1721217 - Part 4: Fix search tests to wait for a stop event a bit longer, r=nika

Differential Revision: https://phabricator.services.mozilla.com/D126844
This commit is contained in:
Anny Gakhokidze 2021-11-30 16:31:35 +00:00
Родитель dd2f9d54f7
Коммит d7d15d402a
3 изменённых файлов: 10 добавлений и 7 удалений

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

@ -50,6 +50,10 @@ add_task(async function test_unknown_host() {
EventUtils.synthesizeKey("KEY_Enter");
await searchPromise;
// With parent initiated loads, we need to give XULBrowserWindow
// time to process the STATE_START event and set the attribute to true.
await new Promise(resolve => executeSoon(resolve));
ok(kButton.hasAttribute("displaystop"), "Should be showing stop");
await TestUtils.waitForCondition(

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

@ -193,12 +193,11 @@ async function testSearchEngine(engineDetails) {
await test.preTest(tab);
}
let googleUrl =
"https://www.google.com/search?client=" + test.code + "&q=foo";
let promises = [
BrowserTestUtils.waitForDocLoadAndStopIt(
"https://www.google.com/search?client=" + test.code + "&q=foo",
tab
),
BrowserTestUtils.browserStopped(tab.linkedBrowser, null, true),
BrowserTestUtils.waitForDocLoadAndStopIt(googleUrl, tab),
BrowserTestUtils.browserStopped(tab.linkedBrowser, googleUrl, true),
];
await test.run(tab);

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

@ -173,8 +173,8 @@ async function testSearchEngine(engineDetails) {
async preTest(tab) {
let browser = tab.linkedBrowser;
BrowserTestUtils.loadURI(browser, "about:newtab");
await BrowserTestUtils.browserLoaded(browser, false, "about:newtab");
await BrowserTestUtils.browserLoaded(browser, false, "about:newtab");
await promiseContentSearchReady(browser);
},
async run(tab) {
@ -199,7 +199,7 @@ async function testSearchEngine(engineDetails) {
let promises = [
BrowserTestUtils.waitForDocLoadAndStopIt(test.searchURL, tab),
BrowserTestUtils.browserStopped(tab.linkedBrowser, null, true),
BrowserTestUtils.browserStopped(tab.linkedBrowser, test.searchURL, true),
];
await test.run(tab);