| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 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 json | 6 import json |
| 7 import unittest | 7 import unittest |
| 8 | 8 |
| 9 from extensions_paths import EXTENSIONS |
| 9 from server_instance import ServerInstance | 10 from server_instance import ServerInstance |
| 10 from test_file_system import TestFileSystem | 11 from test_file_system import TestFileSystem |
| 11 | 12 |
| 13 |
| 12 _TEST_FILESYSTEM = { | 14 _TEST_FILESYSTEM = { |
| 13 'api': { | 15 'api': { |
| 14 '_api_features.json': json.dumps({ | 16 '_api_features.json': json.dumps({ |
| 15 'audioCapture': { | 17 'audioCapture': { |
| 16 'channel': 'stable', | 18 'channel': 'stable', |
| 17 'extension_types': ['platform_app'] | 19 'extension_types': ['platform_app'] |
| 18 }, | 20 }, |
| 19 'background': [ | 21 'background': [ |
| 20 { | 22 { |
| 21 'channel': 'stable', | 23 'channel': 'stable', |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 }, | 127 }, |
| 126 'tabs': { | 128 'tabs': { |
| 127 'partial': 'permissions/tabs.html' | 129 'partial': 'permissions/tabs.html' |
| 128 }, | 130 }, |
| 129 }) | 131 }) |
| 130 } | 132 } |
| 131 } | 133 } |
| 132 } | 134 } |
| 133 } | 135 } |
| 134 | 136 |
| 137 |
| 135 class FeaturesBundleTest(unittest.TestCase): | 138 class FeaturesBundleTest(unittest.TestCase): |
| 136 def setUp(self): | 139 def setUp(self): |
| 137 self._server = ServerInstance.ForTest(TestFileSystem(_TEST_FILESYSTEM)) | 140 self._server = ServerInstance.ForTest( |
| 141 TestFileSystem(_TEST_FILESYSTEM, relative_to=EXTENSIONS)) |
| 138 | 142 |
| 139 def testManifestFeatures(self): | 143 def testManifestFeatures(self): |
| 140 expected_features = { | 144 expected_features = { |
| 141 'background': { | 145 'background': { |
| 142 'name': 'background', | 146 'name': 'background', |
| 143 'channel': 'stable', | 147 'channel': 'stable', |
| 144 'platforms': ['extensions'], | 148 'platforms': ['extensions'], |
| 145 'documentation': 'background_pages.html' | 149 'documentation': 'background_pages.html' |
| 146 }, | 150 }, |
| 147 'manifest_version': { | 151 'manifest_version': { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 'name': 'windows', | 253 'name': 'windows', |
| 250 'platforms': ['extensions'], | 254 'platforms': ['extensions'], |
| 251 'contexts': ['blessed_extension'], | 255 'contexts': ['blessed_extension'], |
| 252 'dependencies': ['api:tabs'] | 256 'dependencies': ['api:tabs'] |
| 253 } | 257 } |
| 254 } | 258 } |
| 255 self.assertEqual( | 259 self.assertEqual( |
| 256 expected_features, | 260 expected_features, |
| 257 self._server.features_bundle.GetAPIFeatures().Get()) | 261 self._server.features_bundle.GetAPIFeatures().Get()) |
| 258 | 262 |
| 263 |
| 259 if __name__ == '__main__': | 264 if __name__ == '__main__': |
| 260 unittest.main() | 265 unittest.main() |
| OLD | NEW |