27d45f5d3ed5b4a7ae0ce16e45615076814fa4c4
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / docs / server2 / test_data / api_data_source / canned_trunk_fs.py
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import json
6
7
8 CANNED_TRUNK_FS_DATA = {
9   'api': {
10     '_api_features.json': json.dumps({
11       'add_rules_tester': { 'dependencies': ['permission:add_rules_tester'] },
12       'ref_test': { 'dependencies': ['permission:ref_test'] },
13       'tester': { 'dependencies': ['permission:tester', 'manifest:tester'] }
14     }),
15     '_manifest_features.json': '{}',
16     '_permission_features.json': '{}',
17     'add_rules_tester.json': json.dumps([{
18       'namespace': 'add_rules_tester',
19       'description': ('A test api with a couple of events which support or '
20                       'do not support rules.'),
21       'types': [],
22       'functions': [],
23       'events': [
24         {
25           'name': 'rules',
26           'options': {
27             'supportsRules': True,
28             'conditions': [],
29             'actions': []
30           }
31         },
32         {
33           'name': 'noRules',
34           'type': 'function',
35           'description': 'Listeners can be registered with this event.',
36           'parameters': []
37         }
38       ]
39     }]),
40     'tester.json': json.dumps([{
41       'namespace': 'tester',
42       'description': 'a test api',
43       'types': [
44         {
45           'id': 'TypeA',
46           'type': 'object',
47           'description': 'A cool thing.',
48           'properties': {
49             'a': {'nodoc': True, 'type': 'string', 'minimum': 0},
50             'b': {'type': 'array', 'optional': True, 'items': {'$ref': 'TypeA'},
51                   'description': 'List of TypeA.'}
52           }
53         }
54       ],
55       'functions': [
56         {
57           'name': 'get',
58           'type': 'function',
59           'description': 'Gets stuff.',
60           'parameters': [
61             {
62               'name': 'a',
63               'description': 'a param',
64               'choices': [
65                 {'type': 'string'},
66                 {'type': 'array', 'items': {'type': 'string'}, 'minItems': 1}
67               ]
68             },
69             {
70               'type': 'function',
71               'name': 'callback',
72               'parameters': [
73                 {'name': 'results', 'type': 'array', 'items': {'$ref': 'TypeA'}}
74               ]
75             }
76           ]
77         }
78       ],
79       'events': [
80         {
81           'name': 'EventA',
82           'type': 'function',
83           'description': 'A cool event.',
84           'parameters': [
85             {'type': 'string', 'name': 'id'},
86             {
87               '$ref': 'TypeA',
88               'name': 'bookmark'
89             }
90           ]
91         }
92       ]
93     }]),
94     'ref_test.json': json.dumps([{
95       'namespace': 'ref_test',
96       'description': 'An API for testing ref\'s',
97       'types': [
98         {
99           'id': 'type1',
100           'type': 'string',
101           'description': '$ref:type2'
102         },
103         {
104           'id': 'type2',
105           'type': 'string',
106           'description': 'A $ref:type3, or $ref:type2'
107         },
108         {
109           'id': 'type3',
110           'type': 'string',
111           'description': '$ref:other.type2 != $ref:ref_test.type2'
112         }
113       ],
114       'events': [
115         {
116           'name': 'event1',
117           'type': 'function',
118           'description': 'We like $ref:type1',
119           'parameters': [
120             {
121               'name': 'param1',
122               'type': 'string'
123             }
124           ]
125         }
126       ],
127       'properties': {
128         'prop1': {
129           '$ref': 'type3'
130         }
131       },
132       'functions': [
133         {
134           'name': 'func1',
135           'type': 'function',
136           'parameters': [
137             {
138               'name': 'param1',
139               'type': 'string'
140             }
141           ]
142         }
143       ]
144     }])
145   },
146   'docs': {
147     'templates': {
148       'intros': {
149         'test.html': '<h1>hi</h1>you<h2>first</h2><h3>inner</h3><h2>second</h2>'
150       },
151       'json': {
152         'api_availabilities.json': json.dumps({
153           'trunk_api': {
154             'channel': 'trunk'
155           },
156           'dev_api': {
157             'channel': 'dev'
158           },
159           'beta_api': {
160             'channel': 'beta'
161           },
162           'stable_api': {
163             'channel': 'stable',
164             'version': 20
165           }
166         }),
167         'intro_tables.json': json.dumps({
168           'tester': {
169             'Permissions': [
170               {
171                 'class': 'override',
172                 'text': '"tester"'
173               },
174               {
175                 'text': 'is an API for testing things.'
176               }
177             ],
178             'Learn More': [
179               {
180                 'link': 'https://tester.test.com/welcome.html',
181                 'text': 'Welcome!'
182               }
183             ]
184           }
185         }),
186         'manifest.json': '{}',
187         'permissions.json': '{}'
188       },
189       'private': {
190         'intro_tables': {
191           'trunk_message.html': 'available on trunk'
192         }
193       }
194     }
195   }
196 }