Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

/* Any copyright is dedicated to the Public Domain.
/**
* Verifies that the SET_SEARCH_MODE action correctly enters search mode
* with the expected engine and properties.
*/
"use strict";
ChromeUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
const { UrlbarTestUtils } = ChromeUtils.importESModule(
);
UrlbarTestUtils.init(this);
return UrlbarTestUtils;
});
add_task(async function test_SET_SEARCH_MODE() {
let searchMode = {
engineName: "Bing",
isGeneralPurposeEngine: true,
source: 3,
isPreview: false,
entry: "other",
};
let action = {
type: "SET_SEARCH_MODE",
data: searchMode,
dismiss: true,
};
await SMATestUtils.executeAndValidateAction(action);
await UrlbarTestUtils.assertSearchMode(window, searchMode);
await UrlbarTestUtils.exitSearchMode(window);
});