зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1572404 - [mozprofile] install addon with browser_specific_settings r=whimboo
webextensions now uses "browser_specific_settings" instead of "applications" in the manifest file. This patch make mozprofile look for both places. Differential Revision: https://phabricator.services.mozilla.com/D42457 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
d465357990
Коммит
2097876b46
|
@ -284,9 +284,15 @@ class AddonManager(object):
|
|||
if is_webext:
|
||||
details['version'] = manifest['version']
|
||||
details['name'] = manifest['name']
|
||||
try:
|
||||
details['id'] = manifest['applications']['gecko']['id']
|
||||
except KeyError:
|
||||
# Bug 1572404 - we support two locations for gecko-specific
|
||||
# metadata.
|
||||
for location in ('applications', 'browser_specific_settings'):
|
||||
try:
|
||||
details['id'] = manifest[location]['gecko']['id']
|
||||
break
|
||||
except KeyError:
|
||||
pass
|
||||
if details['id'] is None:
|
||||
details['id'] = cls._gen_iid(addon_path)
|
||||
details['unpack'] = False
|
||||
else:
|
||||
|
|
Двоичные данные
testing/mozbase/mozprofile/tests/addons/apply-css-id-via-browser-specific-settings.xpi
Normal file
Двоичные данные
testing/mozbase/mozprofile/tests/addons/apply-css-id-via-browser-specific-settings.xpi
Normal file
Двоичный файл не отображается.
|
@ -83,6 +83,19 @@ def test_install_webextension(am):
|
|||
assert 'test-webext@quality.mozilla.org' == details['id']
|
||||
|
||||
|
||||
def test_install_webextension_id_via_browser_specific_settings(am):
|
||||
# See Bug 1572404
|
||||
addon = os.path.join(here, 'addons', 'apply-css-id-via-browser-specific-settings.xpi')
|
||||
am.install(addon)
|
||||
assert len(am.installed_addons) == 1
|
||||
assert os.path.isfile(am.installed_addons[0])
|
||||
assert ('apply-css-id-via-browser-specific-settings.xpi' ==
|
||||
os.path.basename(am.installed_addons[0]))
|
||||
|
||||
details = am.addon_details(am.installed_addons[0])
|
||||
assert 'test-webext@quality.mozilla.org' == details['id']
|
||||
|
||||
|
||||
def test_install_webextension_sans_id(am):
|
||||
addon = os.path.join(here, 'addons', 'apply-css-sans-id.xpi')
|
||||
am.install(addon)
|
||||
|
|
Загрузка…
Ссылка в новой задаче