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

Side by Side Diff: chrome/common/extensions/docs/server2/features_bundle_test.py

Issue 68873003: Docserver: Serve docs out of src/ not src/chrome/common/extensions. This allows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix samples Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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
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
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()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698