diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /toolkit/components/search/tests/xpcshell/test_engine_selector_environment.js | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/search/tests/xpcshell/test_engine_selector_environment.js')
-rw-r--r-- | toolkit/components/search/tests/xpcshell/test_engine_selector_environment.js | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/toolkit/components/search/tests/xpcshell/test_engine_selector_environment.js b/toolkit/components/search/tests/xpcshell/test_engine_selector_environment.js index bf56984cde..401392b955 100644 --- a/toolkit/components/search/tests/xpcshell/test_engine_selector_environment.js +++ b/toolkit/components/search/tests/xpcshell/test_engine_selector_environment.js @@ -388,6 +388,55 @@ const CONFIG_VERSIONS = [ }, ]; +const CONFIG_DEVICE_TYPE_LAYOUT = [ + { + recordType: "engine", + identifier: "engine-no-device-type", + base: {}, + variants: [ + { + environment: { + allRegionsAndLocales: true, + }, + }, + ], + }, + { + recordType: "engine", + identifier: "engine-single-device-type", + base: {}, + variants: [ + { + environment: { + allRegionsAndLocales: true, + deviceType: ["tablet"], + }, + }, + ], + }, + { + recordType: "engine", + identifier: "engine-multiple-device-type", + base: {}, + variants: [ + { + environment: { + allRegionsAndLocales: true, + deviceType: ["tablet", "smartphone"], + }, + }, + ], + }, + { + recordType: "defaultEngines", + specificDefaults: [], + }, + { + recordType: "engineOrders", + orders: [], + }, +]; + const engineSelector = new SearchEngineSelector(); let settings; let settingOverrides; @@ -793,3 +842,15 @@ add_task(async function test_engine_selector_does_not_match_optional_engines() { "Should match engines where optional flag is false or undefined" ); }); + +add_task(async function test_engine_selector_match_device_type() { + await assertActualEnginesEqualsExpected( + CONFIG_DEVICE_TYPE_LAYOUT, + { + locale: "en-CA", + region: "CA", + }, + ["engine-no-device-type"], + "Should only match engines with no device type." + ); +}); |