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.
7 from extensions_paths import EXTENSIONS
8 from third_party.json_schema_compiler.json_parse import OrderedDict
9 from test_file_system import MoveAllTo, MoveTo
12 CANNED_CHANNELS = OrderedDict([
20 CANNED_BRANCHES = OrderedDict([
49 CANNED_TEST_FILE_SYSTEM_DATA = MoveTo(EXTENSIONS, {
51 '_api_features.json': json.dumps({
52 'ref_test': { 'dependencies': ['permission:ref_test'] },
53 'tester': { 'dependencies': ['permission:tester', 'manifest:tester'] }
55 '_manifest_features.json': '{}',
56 '_permission_features.json': '{}'
62 '<h1>hi</h1>you<h2>first</h2><h3>inner</h3><h2>second</h2>'
66 'you<h2>first</h2><h3>inner</h3><h2>second</h2>'
69 'api_availabilities.json': json.dumps({
84 'intro_tables.json': json.dumps({
92 'text': 'is an API for testing things.'
97 'link': 'https://tester.test.com/welcome.html',
103 'manifest.json': '{}',
104 'permissions.json': '{}'
108 'trunk_message.html': 'available on trunk'
110 'table_of_contents.html': '<table-of-contents>',
117 _TEST_WHATS_NEW_JSON = {
118 "backgroundpages.to-be-non-persistent": {
119 "type": "additionsToExistingApis",
120 "description": "backgrounds to be non persistent",
123 "chromeSetting.set-regular-only-scope": {
124 "type": "additionsToExistingApis",
125 "description": "ChromeSetting.set now has a regular_only scope.",
128 "manifest-v1-deprecated": {
129 "type": "manifestChanges",
130 "description": "Manifest version 1 was deprecated in Chrome 18",
136 CANNED_API_FILE_SYSTEM_DATA = MoveAllTo(EXTENSIONS, {
139 '_api_features.json': json.dumps({
161 'systemInfo.stuff': {
165 '_manifest_features.json': json.dumps({
188 '_permission_features.json': json.dumps({
201 'declarativeContent': {
204 'declarativeWebRequest': [
206 'extension_types': ['extension']
209 { 'channel': 'stable',
210 'extension_types': ['extension']
216 'systemInfo.display': {
223 'alarm.json': json.dumps([{
224 'namespace': 'alarm',
225 'description': '<code>alarm</code>'
227 'app_window.json': json.dumps([{
228 'namespace': 'app.window',
229 'description': '<code>app.window</code>'
231 'browser_action.json': json.dumps([{
232 'namespace': 'browserAction',
233 'description': '<code>browserAction</code>'
235 'bluetooth.idl': '\n'.join(('//Copyleft Schmopyright',
237 '//An IDL description, oh my!',
238 'namespace bluetooth {',
239 ' dictionary Socket {',
243 'context_menus.json': json.dumps([{
244 'namespace': 'contextMenus',
247 'json_stable_api.json': json.dumps([{
248 'namespace': 'jsonStableAPI',
249 'description': 'An API with a predetermined availability.'
251 'idle.json': json.dumps([{'namespace': 'idle', 'description': ''}]),
252 'input_ime.json': json.dumps([{
253 'namespace': 'input.ime',
254 'description': 'An API that has the potential to cause some trouble.'
256 'menus.json': json.dumps([{'namespace': 'menus', 'description': ''}]),
257 'tabs.json': json.dumps([{'namespace': 'tabs', 'description': ''}]),
258 'windows.json': json.dumps([{'namespace': 'windows', 'description': ''}])
263 'api_availabilities.json': json.dumps({
278 'intro_tables.json': json.dumps({
281 'Permissions': 'probably none'
285 'manifest.json': '{}',
286 'permissions.json': '{}',
287 'whats_new.json': json.dumps(_TEST_WHATS_NEW_JSON)
291 'alarm.html': 'alarm.html',
292 'app_window.html': 'app_window.html',
293 'contextMenus.html': 'contextMenus.html',
296 'alarm.html': 'alarm.html',
297 'browserAction.html': 'browserAction.html',
298 'contextMenus.html': 'contextMenus.html',
306 '_api_features.json': json.dumps({
325 'systemInfo.stuff': {
329 '_manifest_features.json': json.dumps({
348 'system_info_display': {
355 '_permission_features.json': json.dumps({
368 'declarativeContent': {
371 'declarativeWebRequest': [
372 { 'channel': 'beta' },
374 { 'channel': 'stable'}
380 'alarm.json': json.dumps([{
381 'namespace': 'alarm',
382 'description': '<code>alarm</code>'
384 'app_window.json': json.dumps([{
385 'namespace': 'app.window',
386 'description': '<code>app.window</code>'
388 'browser_action.json': json.dumps([{
389 'namespace': 'browserAction',
390 'description': '<code>browserAction</code>'
392 'idle.json': json.dumps([{'namespace': 'idle'}]),
393 'input_ime.json': json.dumps([{'namespace': 'input.ime'}]),
394 'menus.json': json.dumps([{'namespace': 'menus'}]),
395 'tabs.json': json.dumps([{'namespace': 'tabs'}]),
396 'windows.json': json.dumps([{'namespace': 'windows'}])
401 'api_availabilities.json': json.dumps({
416 'intro_tables.json': json.dumps({
419 'Permissions': 'probably none'
423 'manifest.json': '{}',
424 'permissions.json': '{}',
425 'whats_new.json': json.dumps(_TEST_WHATS_NEW_JSON)
429 'alarm.html': 'alarm.html',
430 'app_window.html': 'app_window.html',
433 'alarm.html': 'alarm.html',
434 'browserAction.html': 'browserAction.html',
442 '_api_features.json': json.dumps({
461 'systemInfo.stuff': {
465 '_manifest_features.json': json.dumps({
478 'system_info_display': {
485 '_permission_features.json': json.dumps({
498 'declarativeContent': {
501 'declarativeWebRequest': [
502 { 'channel': 'beta' },
504 { 'channel': 'stable'}
510 'alarm.json': json.dumps([{
511 'namespace': 'alarm',
512 'description': '<code>alarm</code>'
514 'app_window.json': json.dumps([{
515 'namespace': 'app.window',
516 'description': '<code>app.window</code>'
518 'browser_action.json': json.dumps([{
519 'namespace': 'browserAction',
520 'description': '<code>browserAction</code>'
522 'idle.json': json.dumps([{'namespace': 'idle'}]),
523 'input_ime.json': json.dumps([{'namespace': 'input.ime'}]),
524 'menus.json': json.dumps([{'namespace': 'menus'}]),
525 'tabs.json': json.dumps([{'namespace': 'tabs'}]),
526 'windows.json': json.dumps([{'namespace': 'windows'}])
531 'api_availabilities.json': json.dumps({
546 'intro_tables.json': json.dumps({
549 'Permissions': 'probably none'
553 'manifest.json': '{}',
554 'permissions.json': '{}',
555 'whats_new.json': json.dumps(_TEST_WHATS_NEW_JSON)
559 'alarm.html': 'alarm.html',
560 'app_window.html': 'app_window.html',
563 'alarm.html': 'alarm.html',
564 'browserAction.html': 'browserAction.html',
573 '_manifest_features.json': json.dumps({
599 '_permission_features.json': json.dumps({
612 'declarativeContent': {
615 'declarativeWebRequest': [
616 { 'channel': 'beta' },
618 { 'channel': 'stable'}
620 'systemInfo.display': {
624 'alarm.json': json.dumps([{
625 'namespace': 'alarm',
626 'description': '<code>alarm</code>'
628 'app_window.json': json.dumps([{
629 'namespace': 'app.window',
630 'description': '<code>app.window</code>'
632 'browser_action.json': json.dumps([{
633 'namespace': 'browserAction',
634 'description': '<code>browserAction</code>'
636 'idle.json': json.dumps([{'namespace': 'idle'}]),
637 'input_ime.json': json.dumps([{'namespace': 'input.ime'}]),
638 'menus.json': json.dumps([{'namespace': 'menus'}]),
639 'tabs.json': json.dumps([{'namespace': 'tabs'}]),
640 'windows.json': json.dumps([{'namespace': 'windows'}])
645 '_manifest_features.json': json.dumps({
653 '_permission_features.json': json.dumps({
660 'systemInfo.display': {
667 'idle.json': json.dumps([{'namespace': 'idle'}]),
668 'input_ime.json': json.dumps([{'namespace': 'input.ime'}]),
669 'menus.json': json.dumps([{'namespace': 'menus'}]),
670 'tabs.json': json.dumps([{'namespace': 'tabs'}]),
671 'windows.json': json.dumps([{'namespace': 'windows'}])
676 '_manifest_features.json': json.dumps({
687 '_permission_features.json': json.dumps({
694 'systemInfo.display': {
698 'idle.json': json.dumps([{'namespace': 'idle'}]),
699 'input_ime.json': json.dumps([{'namespace': 'input.ime'}]),
700 'menus.json': json.dumps([{'namespace': 'menus'}]),
701 'tabs.json': json.dumps([{'namespace': 'tabs'}]),
702 'windows.json': json.dumps([{'namespace': 'windows'}])
707 '_manifest_features.json': json.dumps({
714 'system_info_display': {
718 '_permission_features.json': json.dumps({
729 'alarms.idl': '//copy\n\n//desc\nnamespace alarms {}',
730 'idle.json': json.dumps([{'namespace': 'idle'}]),
731 'input_ime.json': json.dumps([{'namespace': 'input.ime'}]),
732 'menus.json': json.dumps([{'namespace': 'menus'}]),
733 'tabs.json': json.dumps([{'namespace': 'tabs'}]),
734 'windows.json': json.dumps([{'namespace': 'windows'}])
739 '_manifest_features.json': json.dumps({
750 '_permission_features.json': json.dumps({
754 'systemInfo.display': {
758 'alarms.idl': '//copy\n\n//desc\nnamespace alarms {}',
759 'idle.json': json.dumps([{'namespace': 'idle'}]),
760 'input_ime.json': json.dumps([{'namespace': 'input.ime'}]),
761 'menus.json': json.dumps([{'namespace': 'menus'}]),
762 'tabs.json': json.dumps([{'namespace': 'tabs'}]),
767 '_manifest_features.json': json.dumps({
775 '_permission_features.json': json.dumps({
783 'bookmarks.json': json.dumps([{'namespace': 'bookmarks'}]),
784 'idle.json': json.dumps([{'namespace': 'idle'}]),
785 'input_ime.json': json.dumps([{'namespace': 'input.ime'}]),
786 'menus.json': json.dumps([{'namespace': 'menus'}]),
787 'tabs.json': json.dumps([{'namespace': 'tabs'}]),
792 '_manifest_features.json': json.dumps({
800 '_permission_features.json': json.dumps({
805 'bookmarks.json': json.dumps([{'namespace': 'bookmarks'}]),
806 'idle.json': json.dumps([{'namespace': 'idle'}]),
807 'input.ime.json': json.dumps([{'namespace': 'input.ime'}]),
808 'menus.json': json.dumps([{'namespace': 'menus'}]),
809 'tabs.json': json.dumps([{'namespace': 'tabs'}]),
814 '_manifest_features.json': json.dumps({
815 'contents': 'nothing of interest here,really'
817 'bookmarks.json': json.dumps([{'namespace': 'bookmarks'}]),
818 'idle.json': json.dumps([{'namespace': 'idle'}]),
819 'input.ime.json': json.dumps([{'namespace': 'input.ime'}]),
820 'menus.json': json.dumps([{'namespace': 'menus'}]),
821 'tabs.json': json.dumps([{'namespace': 'tabs'}]),
822 'pageAction.json': json.dumps([{'namespace': 'pageAction'}]),
823 'webRequest.json': json.dumps([{'namespace': 'webRequest'}])
828 'bookmarks.json': json.dumps([{'namespace': 'bookmarks'}]),
829 'idle.json': json.dumps([{'namespace': 'idle'}]),
830 'input.ime.json': json.dumps([{'namespace': 'input.ime'}]),
831 'menus.json': json.dumps([{'namespace': 'menus'}]),
832 'tabs.json': json.dumps([{'namespace': 'tabs'}]),
833 'pageAction.json': json.dumps([{'namespace': 'pageAction'}]),
834 'webRequest.json': json.dumps([{'namespace': 'webRequest'}])
839 'extension_api.json': json.dumps([
847 'namespace': 'pageAction'
850 'namespace': 'webRequest'
857 'extension_api.json': json.dumps([
865 'namespace': 'pageAction'
868 'namespace': 'experimental.webRequest'
875 'extension_api.json': json.dumps([
883 'namespace': 'pageAction'
890 'extension_api.json': json.dumps([
898 'namespace': 'pageAction'
905 'extension_api.json': json.dumps([
913 'namespace': 'pageAction'
920 'extension_api.json': json.dumps([
928 'namespace': 'pageAction'
935 'extension_api.json': json.dumps([
943 'namespace': 'pageAction'
950 'extension_api.json': json.dumps([
958 'namespace': 'pageAction'
965 'extension_api.json': json.dumps([
973 'namespace': 'pageAction'
980 'extension_api.json': json.dumps([
988 'namespace': 'pageAction'
995 'extension_api.json': json.dumps([
1000 'namespace': 'menus'
1007 'extension_api.json': json.dumps([
1012 'namespace': 'menus'
1019 'extension_api.json': json.dumps([
1024 'namespace': 'experimental.menus'