| 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 testUnknownKeyError(self): | 54 def testUnknownKeyError(self): |
| 54 f = self._parseFeature({ | 55 f = self._parseFeature({ |
| 55 'contexts': ['blessed_extension'], | 56 'contexts': ['blessed_extension'], |
| 56 'channel': 'stable', | 57 'channel': 'stable', |
| 57 'unknownkey': 'unknownvalue' | 58 'unknownkey': 'unknownvalue' |
| 58 }) | 59 }) |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 self.assertFalse(channel_feature.errors) | 132 self.assertFalse(channel_feature.errors) |
| 132 dependency_feature = self._parseFeature( | 133 dependency_feature = self._parseFeature( |
| 133 {'contexts': ['blessed_extension'], | 134 {'contexts': ['blessed_extension'], |
| 134 'dependencies': ['alpha']}) | 135 'dependencies': ['alpha']}) |
| 135 dependency_feature.Validate('APIFeature') | 136 dependency_feature.Validate('APIFeature') |
| 136 self.assertFalse(dependency_feature.errors) | 137 self.assertFalse(dependency_feature.errors) |
| 137 | 138 |
| 138 | 139 |
| 139 if __name__ == '__main__': | 140 if __name__ == '__main__': |
| 140 unittest.main() | 141 unittest.main() |
| OLD | NEW |