Bug 1460232 - Update search test to handle missing region. r?adw
MozReview-Commit-ID: 7TSFXGJcr52
--- a/toolkit/components/search/tests/xpcshell/head_search.js
+++ b/toolkit/components/search/tests/xpcshell/head_search.js
@@ -241,17 +241,18 @@ function getDefaultEngineName(isUS) {
loadUsingSystemPrincipal: true
});
let searchSettings = parseJsonFromStream(chan.open2());
let defaultEngineName = searchSettings.default.searchDefault;
if (isUS === undefined)
isUS = Services.locale.getRequestedLocale() == "en-US" && isUSTimezone();
- if (isUS && ("searchDefault" in searchSettings.US)) {
+ if (isUS && ("US" in searchSettings &&
+ "searchDefault" in searchSettings.US)) {
defaultEngineName = searchSettings.US.searchDefault;
}
return defaultEngineName;
}
/**
* Waits for the cache file to be saved.
* @return {Promise} Resolved when the cache file is saved.