mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 09:49:14 +00:00
Bug 1885121 - Fix a few more tests that are broken with search-config-v2 enabled. r=mcheang
Differential Revision: https://phabricator.services.mozilla.com/D204500
This commit is contained in:
parent
786d8cbb78
commit
660bc76c37
@ -31,6 +31,47 @@ const CONFIG_DEFAULT = [
|
||||
},
|
||||
];
|
||||
|
||||
const CONFIG_V2 = [
|
||||
{
|
||||
recordType: "engine",
|
||||
identifier: "basic",
|
||||
base: {
|
||||
name: "basic",
|
||||
urls: {
|
||||
search: {
|
||||
base: "https://example.com",
|
||||
searchTermParamName: "q",
|
||||
},
|
||||
},
|
||||
},
|
||||
variants: [{ environment: { allRegionsAndLocales: true } }],
|
||||
},
|
||||
{
|
||||
recordType: "engine",
|
||||
identifier: "private",
|
||||
base: {
|
||||
name: "private",
|
||||
urls: {
|
||||
search: {
|
||||
base: "https://example.com",
|
||||
searchTermParamName: "q",
|
||||
},
|
||||
},
|
||||
},
|
||||
variants: [{ environment: { allRegionsAndLocales: true } }],
|
||||
},
|
||||
{
|
||||
recordType: "defaultEngines",
|
||||
globalDefault: "basic",
|
||||
globalDefaultPrivate: "private",
|
||||
specificDefaults: [],
|
||||
},
|
||||
{
|
||||
recordType: "engineOrders",
|
||||
orders: [],
|
||||
},
|
||||
];
|
||||
|
||||
SearchTestUtils.init(this);
|
||||
|
||||
add_setup(async () => {
|
||||
@ -50,7 +91,9 @@ add_setup(async () => {
|
||||
});
|
||||
|
||||
SearchTestUtils.useMockIdleService();
|
||||
await SearchTestUtils.updateRemoteSettingsConfig(CONFIG_DEFAULT);
|
||||
await SearchTestUtils.updateRemoteSettingsConfig(
|
||||
SearchUtils.newSearchConfigEnabled ? CONFIG_V2 : CONFIG_DEFAULT
|
||||
);
|
||||
|
||||
registerCleanupFunction(async () => {
|
||||
let settingsWritten = SearchTestUtils.promiseSearchNotification(
|
||||
|
@ -21,6 +21,65 @@ const CONFIG_DEFAULT = [
|
||||
},
|
||||
];
|
||||
|
||||
const CONFIG_V2 = [
|
||||
{
|
||||
recordType: "engine",
|
||||
identifier: "basic",
|
||||
base: {
|
||||
name: "basic",
|
||||
urls: {
|
||||
search: {
|
||||
base: "https://example.com",
|
||||
searchTermParamName: "q",
|
||||
},
|
||||
trending: {
|
||||
base: "https://example.com/browser/browser/components/search/test/browser/trendingSuggestionEngine.sjs",
|
||||
method: "GET",
|
||||
},
|
||||
},
|
||||
aliases: ["basic"],
|
||||
},
|
||||
variants: [
|
||||
{
|
||||
environment: { allRegionsAndLocales: true },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
recordType: "engine",
|
||||
identifier: "private",
|
||||
base: {
|
||||
name: "private",
|
||||
urls: {
|
||||
search: {
|
||||
base: "https://example.com",
|
||||
searchTermParamName: "q",
|
||||
},
|
||||
suggestions: {
|
||||
base: "https://example.com",
|
||||
method: "GET",
|
||||
searchTermParamName: "search",
|
||||
},
|
||||
},
|
||||
aliases: ["private"],
|
||||
},
|
||||
variants: [
|
||||
{
|
||||
environment: { allRegionsAndLocales: true },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
recordType: "defaultEngines",
|
||||
globalDefault: "basic",
|
||||
specificDefaults: [],
|
||||
},
|
||||
{
|
||||
recordType: "engineOrders",
|
||||
orders: [],
|
||||
},
|
||||
];
|
||||
|
||||
add_setup(async () => {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
@ -39,7 +98,10 @@ add_setup(async () => {
|
||||
});
|
||||
|
||||
await UrlbarTestUtils.formHistory.clear();
|
||||
await SearchTestUtils.setupTestEngines("search-engines", CONFIG_DEFAULT);
|
||||
await SearchTestUtils.setupTestEngines(
|
||||
"search-engines",
|
||||
SearchUtils.newSearchConfigEnabled ? CONFIG_V2 : CONFIG_DEFAULT
|
||||
);
|
||||
|
||||
registerCleanupFunction(async () => {
|
||||
await UrlbarTestUtils.formHistory.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user