зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1525548 - Centralise closing the address bar popup into the head file for urlbar tests. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D26759 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
4ce84a7849
Коммит
385ad0d913
|
@ -50,6 +50,4 @@ add_task(async function() {
|
|||
|
||||
Assert.equal(gBrowser.selectedBrowser.currentURI.spec,
|
||||
"http://example.com/?q=open+a+search", "Should have loaded the correct page");
|
||||
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
|
|
|
@ -45,6 +45,4 @@ add_task(async function() {
|
|||
|
||||
Assert.equal(gBrowser.selectedBrowser.currentURI.spec,
|
||||
"http://example.com/?q=open+a+search", "Should have loaded the correct page");
|
||||
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
|
|
|
@ -28,6 +28,5 @@ add_task(async function noAutofillWhenCaretNotAtEnd() {
|
|||
Assert.equal(gURLBar.selectionStart, 1);
|
||||
Assert.equal(gURLBar.selectionEnd, 1);
|
||||
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
await PlacesUtils.history.clear();
|
||||
});
|
||||
|
|
|
@ -70,5 +70,4 @@ add_task(async function searchSuggestions() {
|
|||
}
|
||||
}
|
||||
Assert.ok(expectedSearches.length == 0);
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
|
|
|
@ -101,8 +101,4 @@ add_task(async function() {
|
|||
info("Page Up again will wrap around to the end of the list");
|
||||
EventUtils.synthesizeKey("KEY_PageUp");
|
||||
assertSelected(maxResults - 1);
|
||||
|
||||
await UrlbarTestUtils.promisePopupClose(window, () => {
|
||||
EventUtils.synthesizeKey("KEY_Escape");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -22,6 +22,4 @@
|
|||
let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1);
|
||||
Assert.equal(result.displayed.title, "bug1060642.example.com",
|
||||
"Result title should be as expected");
|
||||
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
|
|
|
@ -58,6 +58,4 @@ add_task(async function() {
|
|||
info("Ctrl-p to select the previous item");
|
||||
EventUtils.synthesizeKey("p", {ctrlKey: true});
|
||||
assertSelected(0);
|
||||
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
|
|
|
@ -16,6 +16,5 @@ add_task(async function() {
|
|||
"Clicking the history dropmarker should initiate an empty search instead of searching for the loaded URL");
|
||||
is(gURLBar.value, "example.com",
|
||||
"Clicking the history dropmarker should not change the input value");
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -57,6 +57,4 @@
|
|||
}
|
||||
|
||||
EventUtils.synthesizeKey("VK_SHIFT", { type: "keyup" });
|
||||
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
|
|
|
@ -66,6 +66,5 @@ add_task(async function() {
|
|||
"Should have the correct url");
|
||||
}
|
||||
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
gBrowser.removeTab(tab);
|
||||
});
|
||||
|
|
|
@ -19,9 +19,6 @@ add_task(async function prepare() {
|
|||
// Clicking urlbar results causes visits to their associated pages, so clear
|
||||
// that history now.
|
||||
await PlacesUtils.history.clear();
|
||||
|
||||
// Make sure the popup is closed for the next test.
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
|
||||
// Move the mouse away from the urlbar one-offs so that a one-off engine is
|
||||
|
|
|
@ -22,5 +22,4 @@
|
|||
"Result title should be limited");
|
||||
Assert.equal(result.displayed.url.length, UrlbarUtils.MAX_TEXT_LENGTH,
|
||||
"Result url should be limited");
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
|
|
|
@ -17,7 +17,6 @@ add_task(async function init() {
|
|||
await Services.search.moveEngine(engine, 0);
|
||||
|
||||
registerCleanupFunction(async function() {
|
||||
await hidePopup();
|
||||
await PlacesUtils.history.clear();
|
||||
});
|
||||
|
||||
|
|
|
@ -34,8 +34,6 @@ add_task(async function init() {
|
|||
await Services.search.setDefault(oldDefaultEngine);
|
||||
|
||||
await PlacesUtils.history.clear();
|
||||
// Make sure the popup is closed for the next test.
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ add_task(async function init() {
|
|||
gMaxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
|
||||
|
||||
registerCleanupFunction(async function() {
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
await PlacesUtils.history.clear();
|
||||
});
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ add_task(async function init() {
|
|||
Services.prefs.clearUserPref("timesBeforeHidingSuggestionsHint");
|
||||
|
||||
gURLBar.handleRevert();
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -26,8 +26,6 @@ add_task(async function prepare() {
|
|||
// Clicking suggestions causes visits to search results pages, so clear that
|
||||
// history now.
|
||||
await PlacesUtils.history.clear();
|
||||
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -93,8 +91,6 @@ add_task(async function copySuggestionText() {
|
|||
await new Promise((resolve, reject) => waitForClipboard(suggestion, function() {
|
||||
goDoCommand("cmd_copy");
|
||||
}, resolve, reject));
|
||||
await UrlbarTestUtils.promisePopupClose(window, () =>
|
||||
EventUtils.synthesizeKey("KEY_Escape"));
|
||||
});
|
||||
|
||||
async function getFirstSuggestion() {
|
||||
|
|
|
@ -32,8 +32,6 @@ add_task(async function init() {
|
|||
registerCleanupFunction(async () => {
|
||||
await Services.search.setDefault(oldDefaultEngine);
|
||||
await PlacesUtils.history.clear();
|
||||
// Make sure the popup is closed for the next test.
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -15,9 +15,6 @@ add_task(async function init() {
|
|||
registerCleanupFunction(async function() {
|
||||
let engine = Services.search.getEngineByName("Test");
|
||||
await Services.search.removeEngine(engine);
|
||||
// Make sure the popup is closed for the next test.
|
||||
gURLBar.handleRevert();
|
||||
await UrlbarTestUtils.promisePopupClose(window, () => gURLBar.blur());
|
||||
});
|
||||
|
||||
// Search results aren't shown in quantumbar unless search suggestions are
|
||||
|
|
|
@ -66,8 +66,6 @@ add_task(async function test_remove_bookmark_doesnt() {
|
|||
await new Promise(resolve => setTimeout(resolve, 0));
|
||||
await PlacesTestUtils.promiseAsyncUpdates();
|
||||
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
|
||||
Assert.ok(await PlacesUtils.bookmarks.fetch({url: TEST_URL}),
|
||||
"Should still have the URL bookmarked.");
|
||||
});
|
||||
|
|
|
@ -26,3 +26,9 @@ Services.scriptloader.loadSubScript(
|
|||
this);
|
||||
|
||||
const {sinon} = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
|
||||
registerCleanupFunction(async () => {
|
||||
// Ensure the Urlbar popup is always closed at the end of a test, to save having
|
||||
// to do it within each test.
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче