OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import copy | 6 import copy |
7 import feature_compiler | 7 import feature_compiler |
8 import unittest | 8 import unittest |
9 | 9 |
10 class FeatureCompilerTest(unittest.TestCase): | 10 class FeatureCompilerTest(unittest.TestCase): |
(...skipping 24 matching lines...) Expand all Loading... |
35 feature_compiler.ENABLE_ASSERTIONS = False | 35 feature_compiler.ENABLE_ASSERTIONS = False |
36 feature_compiler.STRINGS_TO_UNICODE = True | 36 feature_compiler.STRINGS_TO_UNICODE = True |
37 | 37 |
38 def testFeature(self): | 38 def testFeature(self): |
39 # Test some basic feature parsing for a sanity check. | 39 # Test some basic feature parsing for a sanity check. |
40 f = self._parseFeature({ | 40 f = self._parseFeature({ |
41 'blacklist': ['aaa', 'bbb'], | 41 'blacklist': ['aaa', 'bbb'], |
42 'channel': 'stable', | 42 'channel': 'stable', |
43 'command_line_switch': 'switch', | 43 'command_line_switch': 'switch', |
44 'component_extensions_auto_granted': False, | 44 'component_extensions_auto_granted': False, |
45 'contexts': ['blessed_extension', 'blessed_web_page'], | 45 'contexts': [ |
| 46 'blessed_extension', |
| 47 'blessed_web_page', |
| 48 'lock_screen_extension' |
| 49 ], |
46 'default_parent': True, | 50 'default_parent': True, |
47 'dependencies': ['dependency1', 'dependency2'], | 51 'dependencies': ['dependency1', 'dependency2'], |
48 'extension_types': ['extension'], | 52 'extension_types': ['extension'], |
49 'location': 'component', | 53 'location': 'component', |
50 'internal': True, | 54 'internal': True, |
51 'matches': ['*://*/*'], | 55 'matches': ['*://*/*'], |
52 'max_manifest_version': 1, | 56 'max_manifest_version': 1, |
53 'noparent': True, | 57 'noparent': True, |
54 'platforms': ['mac', 'win'], | 58 'platforms': ['mac', 'win'], |
55 'session_types': ['kiosk', 'regular'], | 59 'session_types': ['kiosk', 'regular'], |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 'channel': 'stable', | 342 'channel': 'stable', |
339 'contexts': ['webui'], | 343 'contexts': ['webui'], |
340 }]) | 344 }]) |
341 | 345 |
342 with self.assertRaisesRegexp(AssertionError, | 346 with self.assertRaisesRegexp(AssertionError, |
343 'No default parent found for bookmarks'): | 347 'No default parent found for bookmarks'): |
344 c._CompileFeature('bookmarks.export', { "whitelist": ["asdf"] }) | 348 c._CompileFeature('bookmarks.export', { "whitelist": ["asdf"] }) |
345 | 349 |
346 if __name__ == '__main__': | 350 if __name__ == '__main__': |
347 unittest.main() | 351 unittest.main() |
OLD | NEW |