Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: tools/json_schema_compiler/feature_compiler_test.py

Issue 2255613003: Introduce session type parameter to extension features (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduce session type parameter to extension features Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/json_schema_compiler/feature_compiler.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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()
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/feature_compiler.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698