Source code
Revision control
Copy as Markdown
Other Tools
/* Any copyright is dedicated to the Public Domain.
"use strict";
/* import-globals-from head.js */
async function doNotSearchModeTest({ trigger, assert }) {
await doTest(async () => {
await openPopup("x");
await trigger();
await assert();
});
}
async function doSearchEngineTest({ trigger, assert }) {
await doTest(async () => {
await openPopup("x");
await UrlbarTestUtils.enterSearchMode(window);
await trigger();
await assert();
});
}
async function doBookmarksTest({ trigger, assert }) {
await doTest(async () => {
await PlacesUtils.bookmarks.insert({
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
title: "bookmark",
});
await openPopup("bookmark");
await UrlbarTestUtils.enterSearchMode(window, {
source: UrlbarUtils.RESULT_SOURCE.BOOKMARKS,
});
await trigger();
await assert();
});
}
async function doHistoryTest({ trigger, assert }) {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.autoFill", false]],
});
await doTest(async () => {
await openPopup("example");
await UrlbarTestUtils.enterSearchMode(window, {
source: UrlbarUtils.RESULT_SOURCE.HISTORY,
});
await trigger();
await assert();
});
await SpecialPowers.popPrefEnv();
}
async function doTabTest({ trigger, assert }) {
await doTest(async () => {
await openPopup("example");
await UrlbarTestUtils.enterSearchMode(window, {
source: UrlbarUtils.RESULT_SOURCE.TABS,
});
await selectRowByProvider("UrlbarProviderPlaces");
await trigger();
await assert();
});
BrowserTestUtils.removeTab(tab);
}