canned_data.py revision ca12bfac764ba476d6cd062bf1dde12cc64c3f40
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
5import json
6
7CANNED_CHANNELS = {
8  'trunk': 'trunk',
9  'dev': 28,
10  'beta': 27,
11  'stable': 26
12}
13
14CANNED_BRANCHES = {
15  'trunk': 'trunk',
16  28: 1500,
17  27: 1453,
18  26: 1410,
19  25: 1364,
20  24: 1312,
21  23: 1271,
22  22: 1229,
23  21: 1180,
24  20: 1132,
25  19: 1084,
26  18: 1025,
27  17: 963,
28  16: 912,
29  15: 874,
30  14: 835,
31  13: 782,
32  12: 742,
33  11: 696,
34  10: 648,
35   9: 597,
36   8: 552,
37   7: 544,
38   6: 495,
39   5: 396
40}
41
42CANNED_TEST_FILE_SYSTEM_DATA = {
43  'api': {
44    '_manifest_features.json': json.dumps({
45      'manifest': 'features'
46    }),
47    '_permission_features.json': json.dumps({
48      'permission': 'features'
49    })
50  },
51  'docs': {
52    'templates': {
53      'intros': {
54        'test.html': '<h1>hi</h1>you<h2>first</h2><h3>inner</h3><h2>second</h2>'
55      },
56      'json': {
57        'api_availabilities.json': json.dumps({
58          'tester': {
59              'channel': 'stable',
60              'version': 42
61            }
62          }),
63        'intro_tables.json': json.dumps({
64          'tester': {
65            'Permissions': [
66              {
67                'perm': 'tester',
68                'text': '"thing1", "thing2"'
69              },
70              {
71                'text': 'is an API for testing things.'
72              }
73            ],
74            'Learn More': [
75              {
76                'link': 'https://tester.test.com/welcome.html',
77                'text': 'Welcome!'
78              }
79            ]
80          }
81        })
82      },
83      'private': {
84        'intro_tables': {
85          'trunk_message.html': 'available on trunk'
86        }
87      }
88    }
89  }
90}
91
92CANNED_API_FILE_SYSTEM_DATA = {
93  'trunk': {
94    'api': {
95      '_api_features.json': json.dumps({
96        'contextMenus': {
97          'channel': 'stable'
98        },
99        'events': {
100          'channel': 'stable'
101        },
102        'extension': {
103          'channel': 'stable'
104        }
105      }),
106      '_manifest_features.json': json.dumps({
107        'history': {
108          'channel': 'beta'
109        },
110        'runtime': {
111          'channel': 'stable'
112        },
113        'storage': {
114          'channel': 'beta'
115        },
116        'sync': {
117          'channel': 'trunk'
118        }
119      }),
120      '_permission_features.json': json.dumps({
121        'alarms': {
122          'channel': 'stable'
123        },
124        'bluetooth': {
125          'channel': 'dev'
126        },
127        'bookmarks': {
128          'channel': 'stable'
129        },
130        'cookies': {
131          'channel': 'dev'
132        },
133        'declarativeContent': {
134          'channel': 'trunk'
135        },
136        'declarativeWebRequest': [
137          { 'channel': 'beta' },
138          # whitelist
139          { 'channel': 'stable'}
140        ],
141        'falseBetaAPI': {
142          'channel': 'beta'
143        },
144        'trunkAPI': {
145          'channel': 'trunk'
146        }
147      }),
148      'idle.json': 'idle contents',
149      'input_ime.json': 'input.ime contents',
150      'menus.json': 'menus contents',
151      'tabs.json': 'tabs contents',
152      'windows.json': 'windows contents'
153    },
154    'docs': {
155      'templates': {
156        'json': {
157          'api_availabilities.json': json.dumps({
158            'jsonAPI1': {
159              'channel': 'stable',
160              'version': 10
161            },
162            'jsonAPI2': {
163              'channel': 'trunk'
164            },
165            'jsonAPI3': {
166              'channel': 'dev'
167            }
168          }),
169          'intro_tables.json': json.dumps({
170            'test': [
171              {
172                'Permissions': 'probably none'
173              }
174            ]
175          })
176        }
177      }
178    }
179  },
180  '1500': {
181    'api': {
182      '_api_features.json': json.dumps({
183        'events': {
184          'channel': 'trunk'
185        },
186        'extension': {
187          'channel': 'stable'
188        },
189        'systemInfo.stuff': {
190          'channel': 'dev'
191        }
192      }),
193      '_manifest_features.json': json.dumps({
194        'contextMenus': {
195          'channel': 'trunk'
196        },
197        'notifications': {
198          'channel': 'beta'
199        },
200        'runtime': {
201          'channel': 'stable'
202        },
203        'storage': {
204          'channel': 'dev'
205        },
206        'sync': {
207          'channel': 'trunk'
208        }
209      }),
210      '_permission_features.json': json.dumps({
211        'alarms': {
212          'channel': 'stable'
213        },
214        'bluetooth': {
215          'channel': 'dev'
216        },
217        'bookmarks': {
218          'channel': 'stable'
219        },
220        'cookies': {
221          'channel': 'dev'
222        },
223        'declarativeContent': {
224          'channel': 'trunk'
225        },
226        'declarativeWebRequest': [
227          { 'channel': 'beta' },
228          # whitelist
229          { 'channel': 'stable'}
230        ],
231        'downloads': {
232          'channel': 'beta'
233        }
234      }),
235      'idle.json': 'idle contents',
236      'input_ime.json': 'input.ime contents',
237      'menus.json': 'menus contents',
238      'tabs.json': 'tabs contents',
239      'windows.json': 'windows contents'
240    }
241  },
242  '1453': {
243    'api': {
244      '_api_features.json': json.dumps({
245        'events': {
246          'channel': 'dev'
247        },
248        'extension': {
249          'channel': 'stable'
250        },
251        'systemInfo.cpu': {
252          'channel': 'stable'
253        },
254        'systemInfo.stuff': {
255          'channel': 'dev'
256        }
257      }),
258      '_manifest_features.json': json.dumps({
259        'notifications': {
260          'channel': 'dev'
261        },
262        'runtime': {
263          'channel': 'stable'
264        },
265        'storage': {
266          'channel': 'dev'
267        }
268      }),
269      '_permission_features.json': json.dumps({
270        'alarms': {
271          'channel': 'stable'
272        },
273        'bluetooth': {
274          'channel': 'dev'
275        },
276        'bookmarks': {
277          'channel': 'stable'
278        },
279        'context_menus': {
280          'channel': 'trunk'
281        },
282        'declarativeContent': {
283          'channel': 'trunk'
284        },
285        'declarativeWebRequest': [
286          { 'channel': 'beta' },
287          # whitelist
288          { 'channel': 'stable'}
289        ],
290        'downloads': {
291          'channel': 'dev'
292        }
293      }),
294      'idle.json': 'idle contents',
295      'input_ime.json': 'input.ime contents',
296      'menus.json': 'menus contents',
297      'tabs.json': 'tabs contents',
298      'windows.json': 'windows contents'
299    }
300  },
301  '1410': {
302    'api': {
303      '_manifest_features.json': json.dumps({
304        'events': {
305          'channel': 'beta'
306        },
307        'notifications': {
308          'channel': 'dev'
309        },
310        'page_action': {
311          'channel': 'stable'
312        },
313        'runtime': {
314          'channel': 'stable'
315        },
316        'web_request': {
317          'channel': 'stable'
318        }
319      }),
320      '_permission_features.json': json.dumps({
321        'alarms': {
322          'channel': 'stable'
323        },
324        'bluetooth': {
325          'channel': 'dev'
326        },
327        'bookmarks': {
328          'channel': 'stable'
329        },
330        'context_menus': {
331          'channel': 'trunk'
332        },
333        'declarativeContent': {
334          'channel': 'trunk'
335        },
336        'declarativeWebRequest': [
337          { 'channel': 'beta' },
338          # whitelist
339          { 'channel': 'stable'}
340        ],
341        'systemInfo.display': {
342          'channel': 'stable'
343        }
344      }),
345      'idle.json': 'idle contents',
346      'input_ime.json': 'input.ime contents',
347      'menus.json': 'menus contents',
348      'tabs.json': 'tabs contents',
349      'windows.json': 'windows contents'
350    }
351  },
352  '1364': {
353    'api': {
354      '_manifest_features.json': json.dumps({
355        'page_action': {
356          'channel': 'stable'
357        },
358        'runtime': {
359          'channel': 'stable'
360        }
361      }),
362      '_permission_features.json': json.dumps({
363        'alarms': {
364          'channel': 'stable'
365        },
366        'bookmarks': {
367          'channel': 'stable'
368        },
369        'systemInfo.display': {
370          'channel': 'stable'
371        },
372        'webRequest': {
373          'channel': 'stable'
374        }
375      }),
376      'idle.json': 'idle contents',
377      'input_ime.json': 'input.ime contents',
378      'menus.json': 'menus contents',
379      'tabs.json': 'tabs contents',
380      'windows.json': 'windows contents'
381    }
382  },
383  '1312': {
384    'api': {
385      '_manifest_features.json': json.dumps({
386        'page_action': {
387          'channel': 'stable'
388        },
389        'runtime': {
390          'channel': 'stable'
391        },
392        'web_request': {
393          'channel': 'stable'
394        }
395      }),
396      '_permission_features.json': json.dumps({
397        'alarms': {
398          'channel': 'stable'
399        },
400        'bookmarks': {
401          'channel': 'stable'
402        },
403        'systemInfo.display': {
404          'channel': 'stable'
405        }
406      }),
407      'idle.json': 'idle contents',
408      'input_ime.json': 'input.ime contents',
409      'menus.json': 'menus contents',
410      'tabs.json': 'tabs contents',
411      'windows.json': 'windows contents'
412    }
413  },
414  '1271': {
415    'api': {
416      '_manifest_features.json': json.dumps({
417        'page_action': {
418          'channel': 'stable'
419        },
420        'runtime': {
421          'channel': 'stable'
422        },
423        'system_info_display': {
424          'channel': 'stable'
425        }
426      }),
427      '_permission_features.json': json.dumps({
428        'alarms': {
429          'channel': 'beta'
430        },
431        'bookmarks': {
432          'channel': 'stable'
433        },
434        'webRequest': {
435          'channel': 'stable'
436        }
437      }),
438      'alarms.idl': 'alarms contents',
439      'idle.json': 'idle contents',
440      'input_ime.json': 'input.ime contents',
441      'menus.json': 'menus contents',
442      'tabs.json': 'tabs contents',
443      'windows.json': 'windows contents'
444    }
445  },
446  '1229': {
447    'api': {
448      '_manifest_features.json': json.dumps({
449        'page_action': {
450          'channel': 'stable'
451        },
452        'runtime': {
453          'channel': 'stable'
454        },
455        'web_request': {
456          'channel': 'stable'
457        }
458      }),
459      '_permission_features.json': json.dumps({
460        'bookmarks': {
461          'channel': 'stable'
462        },
463        'systemInfo.display': {
464          'channel': 'beta'
465        }
466      }),
467      'alarms.idl': 'alarms contents',
468      'idle.json': 'idle contents',
469      'input_ime.json': 'input.ime contents',
470      'menus.json': 'menus contents',
471      'system_info_display.idl': 'systemInfo.display contents',
472      'tabs.json': 'tabs contents'
473    }
474  },
475  '1180': {
476    'api': {
477      '_manifest_features.json': json.dumps({
478        'page_action': {
479          'channel': 'stable'
480        },
481        'runtime': {
482          'channel': 'stable'
483        }
484      }),
485      '_permission_features.json': json.dumps({
486        'bookmarks': {
487          'channel': 'stable'
488        },
489        'webRequest': {
490          'channel': 'stable'
491        }
492      }),
493      'bookmarks.json': 'bookmarks contents',
494      'idle.json': 'idle contents',
495      'input_ime.json': 'input.ime contents',
496      'menus.json': 'menus contents',
497      'tabs.json': 'tabs contents'
498    }
499  },
500  '1132': {
501    'api': {
502      '_manifest_features.json': json.dumps({
503        'bookmarks': {
504          'channel': 'trunk'
505        },
506        'page_action': {
507          'channel': 'stable'
508        }
509      }),
510      '_permission_features.json': json.dumps({
511        'webRequest': {
512          'channel': 'stable'
513        }
514      }),
515      'bookmarks.json': 'bookmarks contents',
516      'idle.json': 'idle contents',
517      'input.ime.json': 'input.ime contents',
518      'menus.json': 'menus contents',
519      'tabs.json': 'tabs contents'
520    }
521  },
522  '1084': {
523    'api': {
524      '_manifest_features.json': json.dumps({
525        'contents': 'nothing of interest here,really'
526      }),
527      'idle.json': 'idle contents',
528      'input.ime.json': 'input.ime contents',
529      'menus.json': 'menus contents',
530      'pageAction.json': 'pageAction contents',
531      'tabs.json': 'tabs contents',
532      'webRequest.json': 'webRequest contents'
533    }
534  },
535  '1025': {
536    'api': {
537      'idle.json': 'idle contents',
538      'input.ime.json': 'input.ime contents',
539      'menus.json': 'menus contents',
540      'pageAction.json': 'pageAction contents',
541      'tabs.json': 'tabs contents',
542      'webRequest.json': 'webRequest contents'
543    }
544  },
545  '963': {
546    'api': {
547      'extension_api.json': json.dumps([
548        {
549          'namespace': 'idle'
550        },
551        {
552          'namespace': 'menus'
553        },
554        {
555          'namespace': 'pageAction'
556        },
557        {
558          'namespace': 'webRequest'
559        }
560      ])
561    }
562  },
563  '912': {
564    'api': {
565      'extension_api.json': json.dumps([
566        {
567          'namespace': 'idle'
568        },
569        {
570          'namespace': 'menus'
571        },
572        {
573          'namespace': 'pageAction'
574        },
575        {
576          'namespace': 'experimental.webRequest'
577        }
578      ])
579    }
580  },
581  '874': {
582    'api': {
583      'extension_api.json': json.dumps([
584        {
585          'namespace': 'idle'
586        },
587        {
588          'namespace': 'menus'
589        },
590        {
591          'namespace': 'pageAction'
592        }
593      ])
594    }
595  },
596  '835': {
597    'api': {
598      'extension_api.json': json.dumps([
599        {
600          'namespace': 'idle'
601        },
602        {
603          'namespace': 'menus'
604        },
605        {
606          'namespace': 'pageAction'
607        }
608      ])
609    }
610  },
611  '782': {
612    'api': {
613      'extension_api.json': json.dumps([
614        {
615          'namespace': 'idle'
616        },
617        {
618          'namespace': 'menus'
619        },
620        {
621          'namespace': 'pageAction'
622        }
623      ])
624    }
625  },
626  '742': {
627    'api': {
628      'extension_api.json': json.dumps([
629        {
630          'namespace': 'idle'
631        },
632        {
633          'namespace': 'menus'
634        },
635        {
636          'namespace': 'pageAction'
637        }
638      ])
639    }
640  },
641  '696': {
642    'api': {
643      'extension_api.json': json.dumps([
644        {
645          'namespace': 'idle'
646        },
647        {
648          'namespace': 'menus'
649        },
650        {
651          'namespace': 'pageAction'
652        }
653      ])
654    }
655  },
656  '648': {
657    'api': {
658      'extension_api.json': json.dumps([
659        {
660          'namespace': 'idle'
661        },
662        {
663          'namespace': 'menus'
664        },
665        {
666          'namespace': 'pageAction'
667        }
668      ])
669    }
670  },
671  '597': {
672    'api': {
673      'extension_api.json': json.dumps([
674        {
675          'namespace': 'idle'
676        },
677        {
678          'namespace': 'menus'
679        },
680        {
681          'namespace': 'pageAction'
682        }
683      ])
684    }
685  },
686  '552': {
687    'api': {
688      'extension_api.json': json.dumps([
689        {
690          'namespace': 'idle'
691        },
692        {
693          'namespace': 'menus'
694        },
695        {
696          'namespace': 'pageAction'
697        }
698      ])
699    }
700  },
701  '544': {
702    'api': {
703      'extension_api.json': json.dumps([
704        {
705          'namespace': 'idle'
706        },
707        {
708          'namespace': 'menus'
709        }
710      ])
711    }
712  },
713  '495': {
714    'api': {
715      'extension_api.json': json.dumps([
716        {
717          'namespace': 'idle'
718        },
719        {
720          'namespace': 'menus'
721        }
722      ])
723    }
724  },
725  '396': {
726    'api': {
727      'extension_api.json': json.dumps([
728        {
729          'namespace': 'idle'
730        },
731        {
732          'namespace': 'experimental.menus'
733        }
734      ])
735    }
736  }
737}
738