| LEFT | RIGHT |
| 1 # This Source Code Form is subject to the terms of the Mozilla Public | 1 # This Source Code Form is subject to the terms of the Mozilla Public |
| 2 # License, v. 2.0. If a copy of the MPL was not distributed with this | 2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 4 | 4 |
| 5 import difflib | 5 import difflib |
| 6 import json | 6 import json |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 import shutil | 9 import shutil |
| 10 import zipfile | 10 import zipfile |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 manifest = json.loads(package.read(os.path.join(prefix, 'manifest.json'))) | 320 manifest = json.loads(package.read(os.path.join(prefix, 'manifest.json'))) |
| 321 filenames = package.namelist() | 321 filenames = package.namelist() |
| 322 scripts = [ | 322 scripts = [ |
| 323 'ext/common.js', | 323 'ext/common.js', |
| 324 'ext/background.js', | 324 'ext/background.js', |
| 325 ] | 325 ] |
| 326 | 326 |
| 327 assert (os.path.join(prefix, 'qunit/index.html') in filenames) == devenv | 327 assert (os.path.join(prefix, 'qunit/index.html') in filenames) == devenv |
| 328 assert (os.path.join(prefix, 'devenvPoller__.js') in filenames) == devenv | 328 assert (os.path.join(prefix, 'devenvPoller__.js') in filenames) == devenv |
| 329 assert (os.path.join(prefix, 'devenvVersion__') in filenames) == devenv | 329 assert (os.path.join(prefix, 'devenvVersion__') in filenames) == devenv |
| 330 assert (os.path.join(prefix, 'qunit/tests.js') in filenames) == devenv |
| 331 assert (os.path.join(prefix, 'qunit/tests.js.map') in filenames) == devenv |
| 330 | 332 |
| 331 if devenv: | 333 if devenv: |
| 332 quint_index = package.read(os.path.join(prefix, 'qunit/index.html')) | 334 quint_index = package.read(os.path.join(prefix, 'qunit/index.html')) |
| 333 assert '../ext/common.js' in quint_index | 335 assert '../ext/common.js' in quint_index |
| 334 assert '../ext/background.js' in quint_index | 336 assert '../ext/background.js' in quint_index |
| 335 | 337 |
| 336 assert set(manifest['background']['scripts']) == set( | 338 assert set(manifest['background']['scripts']) == set( |
| 337 scripts + ['devenvPoller__.js'] | 339 scripts + ['devenvPoller__.js'] |
| 338 ) | 340 ) |
| 339 else: | 341 else: |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 expected = os.path.join( | 485 expected = os.path.join( |
| 484 os.path.dirname(__file__), | 486 os.path.dirname(__file__), |
| 485 'expecteddata', | 487 'expecteddata', |
| 486 filename.format(name, ext), | 488 filename.format(name, ext), |
| 487 ) | 489 ) |
| 488 | 490 |
| 489 assert_manifest_content( | 491 assert_manifest_content( |
| 490 package.read(os.path.join(folder, '{}.{}'.format(name, ext))), | 492 package.read(os.path.join(folder, '{}.{}'.format(name, ext))), |
| 491 expected, | 493 expected, |
| 492 ) | 494 ) |
| LEFT | RIGHT |