Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Commit

Permalink
Merge pull request #443 from diox/only-show-e10s-warning-for-extensions
Browse files Browse the repository at this point in the history
Don't show e10s compatibilty warning for non-extensions that have an install.rdf
  • Loading branch information
diox committed Jun 28, 2016
2 parents 5b72a21 + b60ae7f commit 596fe17
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
Binary file added tests/resources/validate/dictionary.xpi
Binary file not shown.
26 changes: 26 additions & 0 deletions tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,29 @@ def test_validate_jpm_multiprocess_compatible():
assert data['metadata']['version'] == u'0.0.3'
assert data['metadata']['listed'] is True
assert data['metadata']['id'] == u'@test-addon'


def test_validate_dictionnary_no_multiprocess_compatible_warning():
"""Integration test for a dictionnary xpi, without mocks."""
result = validate(path='tests/resources/validate/dictionary.xpi')
data = json.loads(result)
assert data['success'] is True
assert data['errors'] == 0
assert data['notices'] == 0
assert data['warnings'] == 0
assert data['compatibility_summary']
assert data['compatibility_summary']['errors'] == 0
assert data['compatibility_summary']['notices'] == 0
assert data['compatibility_summary']['warnings'] == 0
assert data['detected_type'] == 'dictionary'
assert data['messages'] == []
assert data['message_tree'] == {}
assert data['signing_summary']['high'] == 0
assert data['signing_summary']['medium'] == 0
assert data['signing_summary']['low'] == 0
assert data['signing_summary']['trivial'] == 0
assert data['metadata']
assert data['metadata']['name'] == u'My Fake Dictionary'
assert data['metadata']['version'] == u'1.0.0'
assert data['metadata']['listed'] is True
assert data['metadata']['id'] == u'my@dict'
3 changes: 2 additions & 1 deletion validator/submain.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from validator.xpi import XPIManager

from constants import (PACKAGE_ANY, PACKAGE_EXTENSION, PACKAGE_SEARCHPROV,
PACKAGE_THEME)
PACKAGE_SUBPACKAGE, PACKAGE_THEME)


types = {0: 'Unknown',
Expand Down Expand Up @@ -386,6 +386,7 @@ def test_inner_package(err, xpi_package, for_appversions=None):
if (err.get_resource('has_install_rdf') and
not err.get_resource('has_manifest_json') and
not err.get_resource('is_multiprocess_compatible') and
err.detected_type in (PACKAGE_EXTENSION, PACKAGE_SUBPACKAGE) and
'firefox' in supports):
# If it's an old-style xpi, or a sdk extension, that supports Firefox,
# but is not a Web Extension, then we raise a warning if multiprocess
Expand Down

0 comments on commit 596fe17

Please sign in to comment.