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 feature_compiler | 6 import feature_compiler |
7 import unittest | 7 import unittest |
8 | 8 |
9 class FeatureCompilerTest(unittest.TestCase): | 9 class FeatureCompilerTest(unittest.TestCase): |
10 """Test the FeatureCompiler. Note that we test that the expected features are | 10 """Test the FeatureCompiler. Note that we test that the expected features are |
(...skipping 28 matching lines...) Expand all Loading... |
39 'contexts': ['blessed_extension', 'blessed_web_page'], | 39 'contexts': ['blessed_extension', 'blessed_web_page'], |
40 'default_parent': True, | 40 'default_parent': True, |
41 'dependencies': ['dependency1', 'dependency2'], | 41 'dependencies': ['dependency1', 'dependency2'], |
42 'extension_types': ['extension'], | 42 'extension_types': ['extension'], |
43 'location': 'component', | 43 'location': 'component', |
44 'internal': True, | 44 'internal': True, |
45 'matches': ['*://*/*'], | 45 'matches': ['*://*/*'], |
46 'max_manifest_version': 1, | 46 'max_manifest_version': 1, |
47 'noparent': True, | 47 'noparent': True, |
48 'platforms': ['mac', 'win'], | 48 'platforms': ['mac', 'win'], |
| 49 'session_types': ['kiosk', 'regular'], |
49 'whitelist': ['zzz', 'yyy'] | 50 'whitelist': ['zzz', 'yyy'] |
50 }) | 51 }) |
51 self.assertFalse(f.errors) | 52 self.assertFalse(f.errors) |
52 | 53 |
53 def testInvalidAll(self): | 54 def testInvalidAll(self): |
54 f = self._parseFeature({ | 55 f = self._parseFeature({ |
55 'channel': 'stable', | 56 'channel': 'stable', |
56 'dependencies': 'all', | 57 'dependencies': 'all', |
57 }) | 58 }) |
58 self._hasError(f, 'Illegal value: "all"') | 59 self._hasError(f, 'Illegal value: "all"') |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 self.assertFalse(channel_feature.errors) | 139 self.assertFalse(channel_feature.errors) |
139 dependency_feature = self._parseFeature( | 140 dependency_feature = self._parseFeature( |
140 {'contexts': ['blessed_extension'], | 141 {'contexts': ['blessed_extension'], |
141 'dependencies': ['alpha']}) | 142 'dependencies': ['alpha']}) |
142 dependency_feature.Validate('APIFeature') | 143 dependency_feature.Validate('APIFeature') |
143 self.assertFalse(dependency_feature.errors) | 144 self.assertFalse(dependency_feature.errors) |
144 | 145 |
145 | 146 |
146 if __name__ == '__main__': | 147 if __name__ == '__main__': |
147 unittest.main() | 148 unittest.main() |
OLD | NEW |