Bug 1333303 - Remove the google4 dir from the test and relax the list comparison. r=whimboo
authorFrancois Marier <francois@mozilla.com>
Wed, 25 Jan 2017 15:45:12 -0800
changeset 340878 c5621cb6f9075d731ccb28dcf20dd29deae2bddd
parent 340877 0cdf5249e6d06897c0ffec56a6675dc971a16847
child 340897 1cc159c7a0445ec51e335c8a1a1cceea7bbf8380
child 340909 a20c22b2d924992859e430895639f2748b75190c
push id31317
push usercbook@mozilla.com
push dateMon, 06 Feb 2017 11:55:02 +0000
treeherdermozilla-central@c5621cb6f907 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1333303
milestone54.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
Bug 1333303 - Remove the google4 dir from the test and relax the list comparison. r=whimboo MozReview-Commit-ID: 2KY6CEQZYOk
testing/firefox-ui/tests/functional/security/test_safe_browsing_initial_download.py
--- a/testing/firefox-ui/tests/functional/security/test_safe_browsing_initial_download.py
+++ b/testing/firefox-ui/tests/functional/security/test_safe_browsing_initial_download.py
@@ -51,41 +51,41 @@ class TestSafeBrowsingInitialDownload(Pu
     }
 
     def get_safebrowsing_files(self, is_v4):
         files = []
 
         if is_v4:
             my_file_extensions = self.v4_file_extensions
         else:  # v2
-            # safebrowsing dir should have a 'google4' directory where
-            # v4 databases exist.
-            files.append('google4')
             my_file_extensions = self.v2_file_extensions
 
         for pref_name in self.prefs_download_lists:
             base_names = self.marionette.get_pref(pref_name).split(',')
             for ext in my_file_extensions:
-                files.extend(['{file}.{ext}'.format(file=f, ext=ext)
+                files.extend(['{name}.{ext}'.format(name=f, ext=ext)
                               for f in base_names if f and f.endswith('-proto') == is_v4])
 
         return set(sorted(files))
 
     def setUp(self):
         super(TestSafeBrowsingInitialDownload, self).setUp()
 
         # Force the preferences for the new profile
         enforce_prefs = self.prefs_safebrowsing
         enforce_prefs.update(self.prefs_provider_update_time)
         self.marionette.enforce_gecko_prefs(enforce_prefs)
 
         self.safebrowsing_path = os.path.join(self.marionette.instance.profile.profile,
                                               'safebrowsing')
         self.safebrowsing_v2_files = self.get_safebrowsing_files(False)
-        self.safebrowsing_v4_files = self.get_safebrowsing_files(True)
+        # Bug 1330253 - Leave the next line disabled until we have google API key
+        #               on the CI machines.
+        # self.safebrowsing_v4_files = self.get_safebrowsing_files(True)
+        self.safebrowsing_v4_files = []
 
     def tearDown(self):
         try:
             # Restart with a fresh profile
             self.restart(clean=True)
         finally:
             super(TestSafeBrowsingInitialDownload, self).tearDown()
 
@@ -93,14 +93,16 @@ class TestSafeBrowsingInitialDownload(Pu
         def check_downloaded(_):
             return reduce(lambda state, pref: state and int(self.marionette.get_pref(pref)) != 1,
                           self.prefs_provider_update_time.keys(), True)
 
         try:
             Wait(self.marionette, timeout=60).until(
                 check_downloaded, message='Not all safebrowsing files have been downloaded')
         finally:
-            self.assertSetEqual(self.safebrowsing_v2_files,
-                                set(os.listdir(self.safebrowsing_path)))
-            # Bug 1330253 - Leave the next test disabled until we have google api key
-            #               on the CI machines.
-            # self.assertSetEqual(self.safebrowsing_v4_files,
-            #                     set(os.listdir(os.path.join(self.safebrowsing_path, 'google4'))))
+            files_on_disk_toplevel = os.listdir(self.safebrowsing_path)
+            for f in self.safebrowsing_v2_files:
+                self.assertIn(f, files_on_disk_toplevel)
+
+            if len(self.safebrowsing_v4_files) > 0:
+                files_on_disk_google4 = os.listdir(os.path.join(self.safebrowsing_path, 'google4'))
+                for f in self.safebrowsing_v4_files:
+                    self.assertIn(f, files_on_disk_google4)