author | Francois Marier <francois@mozilla.com> |
Tue, 06 Feb 2018 15:36:48 -0800 | |
changeset 403247 | 0cdfcf8734a9eeb40ff2d0f8a60fa05d8a56a6bb |
parent 403246 | 474bea93396d7923707b9273b18f2189fe51ea07 |
child 403248 | 14128b25db9fab9e597935876a318ac927f21ef2 |
push id | 99755 |
push user | btara@mozilla.com |
push date | Sat, 10 Feb 2018 10:02:59 +0000 |
treeherder | mozilla-inbound@0417e1acfc10 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | gcp |
bugs | 1436213 |
milestone | 60.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/toolkit/components/url-classifier/SafeBrowsing.jsm +++ b/toolkit/components/url-classifier/SafeBrowsing.jsm @@ -334,16 +334,19 @@ this.SafeBrowsing = { } else { providerStr += ", " + provider; } }); log("Providers: " + providerStr); } Object.keys(this.providers).forEach(function(provider) { + if (provider == "test") { + return; // skip + } let updateURL = Services.urlFormatter.formatURLPref( "browser.safebrowsing.provider." + provider + ".updateURL"); let gethashURL = Services.urlFormatter.formatURLPref( "browser.safebrowsing.provider." + provider + ".gethashURL"); updateURL = updateURL.replace("SAFEBROWSING_ID", clientID); gethashURL = gethashURL.replace("SAFEBROWSING_ID", clientID); // Disable updates and gethash if the Google API key is missing.
--- a/toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js +++ b/toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js @@ -4,28 +4,31 @@ ChromeUtils.import("resource://testing-c // 'Cc["@mozilla.org/xre/app-info;1"]' for xpcshell has no nsIXULAppInfo // so that we have to update it to make nsURLFormatter.js happy. // (SafeBrowsing.init() will indirectly use nsURLFormatter.js) updateAppInfo(); function run_test() { SafeBrowsing.init(); - let origList = Services.prefs.getCharPref("browser.safebrowsing.provider.google.lists"); + let origListV2 = Services.prefs.getCharPref("browser.safebrowsing.provider.google.lists"); + let origListV4 = Services.prefs.getCharPref("browser.safebrowsing.provider.google4.lists"); - // Remove 'goog-malware-shavar' from the original. - let trimmedList = origList.replace("goog-malware-shavar,", ""); - Services.prefs.setCharPref("browser.safebrowsing.provider.google.lists", trimmedList); + // Ensure there's a list missing in both Safe Browsing V2 and V4. + let trimmedListV2 = origListV2.replace("goog-malware-shavar,", ""); + Services.prefs.setCharPref("browser.safebrowsing.provider.google.lists", trimmedListV2); + let trimmedListV4 = origListV4.replace("goog-malware-proto,", ""); + Services.prefs.setCharPref("browser.safebrowsing.provider.google4.lists", trimmedListV4); try { // Bug 1274685 - Unowned Safe Browsing tables break list updates // // If SafeBrowsing.registerTableWithURLs() doesn't check if // a provider is found before registering table, an exception // will be thrown while accessing a null object. // SafeBrowsing.registerTables(); } catch (e) { ok(false, "Exception thrown due to " + e.toString()); } - - Services.prefs.setCharPref("browser.safebrowsing.provider.google.lists", origList); + Services.prefs.clearUserPref("browser.safebrowsing.provider.google.lists"); + Services.prefs.clearUserPref("browser.safebrowsing.provider.google4.lists"); }