Bug 1460743 - Don't install testing/profiles on Google Chrome; r?ahal draft
authorRob Wood <rwood@mozilla.com>
Wed, 06 Jun 2018 13:28:54 -0400
changeset 806436 9f2e9b644487d1f0c7db1585f5cea894d1d90eff
parent 806435 7c0dbaddc06ce79002dcb25595bcc86c8a5b694f
push id112880
push userrwood@mozilla.com
push dateSat, 09 Jun 2018 14:30:20 +0000
reviewersahal
bugs1460743
milestone62.0a1
Bug 1460743 - Don't install testing/profiles on Google Chrome; r?ahal MozReview-Commit-ID: HW8iqfTDcd0
testing/mozbase/mozprofile/mozprofile/profile.py
testing/mozbase/mozprofile/tests/test_profile.py
--- a/testing/mozbase/mozprofile/mozprofile/profile.py
+++ b/testing/mozbase/mozprofile/mozprofile/profile.py
@@ -491,18 +491,18 @@ class ChromeProfile(BaseProfile):
     class AddonManager(list):
         def install(self, addons):
             if isinstance(addons, string_types):
                 addons = [addons]
             self.extend(addons)
 
         @classmethod
         def is_addon(self, addon):
-            # TODO Implement this properly
-            return os.path.exists(addon)
+            # Don't include testing/profiles on Google Chrome
+            return False
 
     def __init__(self, **kwargs):
         super(ChromeProfile, self).__init__(**kwargs)
 
         if self.create_new:
             self.profile = os.path.join(self.profile, 'Default')
         self._reset()
 
--- a/testing/mozbase/mozprofile/tests/test_profile.py
+++ b/testing/mozbase/mozprofile/tests/test_profile.py
@@ -84,15 +84,19 @@ def test_merge_profile(cls):
             prefs.update(Preferences.read_json(path))
         except ValueError:
             prefs.update(Preferences.read_prefs(path))
 
     assert 'foo' in prefs
     assert len(prefs) == len(profile.preference_file_names) + 1
     assert all(name in prefs for name in profile.preference_file_names)
 
-    assert len(profile._addons) == 1
-    assert profile._addons[0].endswith('empty.xpi')
-    assert os.path.exists(profile._addons[0])
+    # for Google Chrome currently we ignore webext in profile prefs
+    if cls == Profile:
+        assert len(profile._addons) == 1
+        assert profile._addons[0].endswith('empty.xpi')
+        assert os.path.exists(profile._addons[0])
+    else:
+        assert len(profile._addons) == 0
 
 
 if __name__ == '__main__':
     mozunit.main()