Bug 1395733 - Ensure the default value of urlclassifier.malwareTable is always sorted. r?gcp draft
authorFrancois Marier <francois@mozilla.com>
Thu, 31 Aug 2017 14:54:11 -0700
changeset 656964 b461d653e6c541f493a0bcbdbf0ecb856f9b2fbe
parent 656783 4984da22242841a5d84c4e5fd866e93a450d9723
child 729301 5dfe079c4a732e806b5633489852241a1a07cc6c
push id77390
push userfmarier@mozilla.com
push dateThu, 31 Aug 2017 22:40:38 +0000
reviewersgcp
bugs1395733
milestone57.0a1
Bug 1395733 - Ensure the default value of urlclassifier.malwareTable is always sorted. r?gcp MozReview-Commit-ID: 10M2ZpDyAI9
browser/app/profile/firefox.js
modules/libpref/init/all.js
toolkit/components/url-classifier/tests/unit/test_malwaretable_pref.js
toolkit/components/url-classifier/tests/unit/xpcshell.ini
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1718,17 +1718,17 @@ pref("extensions.formautofill.creditCard
 pref("extensions.formautofill.firstTimeUse", true);
 pref("extensions.formautofill.heuristics.enabled", true);
 pref("extensions.formautofill.loglevel", "Warn");
 
 // Whether or not to restore a session with lazy-browser tabs.
 pref("browser.sessionstore.restore_tabs_lazily", true);
 
 // Enable safebrowsing v4 tables (suffixed by "-proto") update.
-pref("urlclassifier.malwareTable", "goog-malware-proto,goog-unwanted-proto,test-malware-simple,test-unwanted-simple,test-harmful-simple");
+pref("urlclassifier.malwareTable", "goog-malware-proto,goog-unwanted-proto,test-harmful-simple,test-malware-simple,test-unwanted-simple");
 #ifdef MOZILLA_OFFICIAL
 pref("urlclassifier.phishTable", "goog-phish-proto,test-phish-simple");
 #else
 pref("urlclassifier.phishTable", "googpub-phish-proto,test-phish-simple");
 #endif
 
 pref("urlclassifier.downloadAllowTable", "goog-downloadwhite-proto");
 pref("urlclassifier.downloadBlockTable", "goog-badbinurl-proto");
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5368,17 +5368,17 @@ pref("dom.forms.inputmode", true);
 #endif
 
 pref("dom.flyweb.enabled", false);
 
 // Enable mapped array buffer by default.
 pref("dom.mapped_arraybuffer.enabled", true);
 
 // The tables used for Safebrowsing phishing and malware checks
-pref("urlclassifier.malwareTable", "goog-malware-shavar,goog-unwanted-shavar,test-malware-simple,test-unwanted-simple,test-harmful-simple");
+pref("urlclassifier.malwareTable", "goog-malware-shavar,goog-unwanted-shavar,test-harmful-simple,test-malware-simple,test-unwanted-simple");
 #ifdef MOZILLA_OFFICIAL
 // In the official build, we are allowed to use google's private
 // phishing list "goog-phish-shavar". See Bug 1288840.
 pref("urlclassifier.phishTable", "goog-phish-shavar,test-phish-simple");
 #else
 pref("urlclassifier.phishTable", "googpub-phish-shavar,test-phish-simple");
 #endif
 
new file mode 100644
--- /dev/null
+++ b/toolkit/components/url-classifier/tests/unit/test_malwaretable_pref.js
@@ -0,0 +1,4 @@
+// Ensure that the default value of malwareTable is always in sorted order
+let originalValue = prefBranch.getCharPref("urlclassifier.malwareTable");
+let sortedValue = originalValue.split(",").sort().join(",");
+do_check_eq(originalValue, sortedValue);
--- a/toolkit/components/url-classifier/tests/unit/xpcshell.ini
+++ b/toolkit/components/url-classifier/tests/unit/xpcshell.ini
@@ -16,10 +16,11 @@ support-files =
 [test_partial.js]
 [test_prefixset.js]
 [test_threat_type_conversion.js]
 [test_provider_url.js]
 [test_streamupdater.js]
 [test_digest256.js]
 [test_listmanager.js]
 [test_pref.js]
+[test_malwaretable_pref.js]
 [test_safebrowsing_protobuf.js]
 [test_platform_specific_threats.js]
\ No newline at end of file