Skip to content

Commit

Permalink
Bug 1641881 - Switch browser_ext_settings_overrides_default_search.js…
Browse files Browse the repository at this point in the history
… to use a different search engine for testing. r=mixedpuppy

Differential Revision: https://phabricator.services.mozilla.com/D77471
  • Loading branch information
Standard8 committed May 29, 2020
1 parent 02baef5 commit 577303a
Showing 1 changed file with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ add_task(async function test_extension_setting_multiple_default_engine() {
manifest: {
chrome_settings_overrides: {
search_provider: {
name: "Twitter",
name: "Bing",
search_url: "https://example.com/?q={searchTerms}",
is_default: true,
},
Expand All @@ -197,8 +197,8 @@ add_task(async function test_extension_setting_multiple_default_engine() {

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);

await ext2.unload();
Expand Down Expand Up @@ -239,7 +239,7 @@ add_task(
manifest: {
chrome_settings_overrides: {
search_provider: {
name: "Twitter",
name: "Bing",
search_url: "https://example.com/?q={searchTerms}",
is_default: true,
},
Expand All @@ -262,16 +262,16 @@ add_task(

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);

await ext1.unload();

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);

await ext2.unload();
Expand Down Expand Up @@ -309,15 +309,15 @@ add_task(async function test_user_changing_default_engine() {
"Default engine is DuckDuckGo"
);

let engine = Services.search.getEngineByName("Twitter");
let engine = Services.search.getEngineByName("Bing");
await Services.search.setDefault(engine);

await ext1.unload();

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);
restoreDefaultEngine();
});
Expand Down Expand Up @@ -352,13 +352,13 @@ add_task(async function test_user_change_with_disabling() {
"Default engine is DuckDuckGo"
);

let engine = Services.search.getEngineByName("Twitter");
let engine = Services.search.getEngineByName("Bing");
await Services.search.setDefault(engine);

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);

let disabledPromise = awaitEvent("shutdown", EXTENSION1_ID);
Expand All @@ -368,8 +368,8 @@ add_task(async function test_user_change_with_disabling() {

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);

let processedPromise = awaitEvent("searchEngineProcessed", EXTENSION1_ID);
Expand All @@ -378,8 +378,8 @@ add_task(async function test_user_change_with_disabling() {

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);
await ext1.unload();
await restoreDefaultEngine();
Expand Down Expand Up @@ -416,7 +416,7 @@ add_task(async function test_two_addons_with_first_disabled_before_second() {
},
chrome_settings_overrides: {
search_provider: {
name: "Twitter",
name: "Bing",
search_url: "https://example.com/?q={searchTerms}",
is_default: true,
},
Expand Down Expand Up @@ -450,8 +450,8 @@ add_task(async function test_two_addons_with_first_disabled_before_second() {

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);

let enabledPromise = awaitEvent("ready", EXTENSION1_ID);
Expand All @@ -460,8 +460,8 @@ add_task(async function test_two_addons_with_first_disabled_before_second() {

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);
await ext2.unload();

Expand Down Expand Up @@ -510,7 +510,7 @@ add_task(async function test_two_addons_with_first_disabled() {
},
chrome_settings_overrides: {
search_provider: {
name: "Twitter",
name: "Bing",
search_url: "https://example.com/?q={searchTerms}",
is_default: true,
},
Expand All @@ -533,8 +533,8 @@ add_task(async function test_two_addons_with_first_disabled() {

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);

let disabledPromise = awaitEvent("shutdown", EXTENSION1_ID);
Expand All @@ -544,8 +544,8 @@ add_task(async function test_two_addons_with_first_disabled() {

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);

let enabledPromise = awaitEvent("ready", EXTENSION1_ID);
Expand All @@ -554,8 +554,8 @@ add_task(async function test_two_addons_with_first_disabled() {

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);
await ext2.unload();

Expand Down Expand Up @@ -604,7 +604,7 @@ add_task(async function test_two_addons_with_second_disabled() {
},
chrome_settings_overrides: {
search_provider: {
name: "Twitter",
name: "Bing",
search_url: "https://example.com/?q={searchTerms}",
is_default: true,
},
Expand All @@ -627,8 +627,8 @@ add_task(async function test_two_addons_with_second_disabled() {

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);

let disabledPromise = awaitEvent("shutdown", EXTENSION2_ID);
Expand All @@ -648,8 +648,8 @@ add_task(async function test_two_addons_with_second_disabled() {

is(
(await Services.search.getDefault()).name,
"Twitter",
"Default engine is Twitter"
"Bing",
"Default engine is Bing"
);
await ext2.unload();

Expand Down

0 comments on commit 577303a

Please sign in to comment.