Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / docs / server2 / test_data / object_level_availability / tabs.py
index 0c77b28..c881fe5 100644 (file)
 
 import json
 
+from extensions_paths import CHROME_EXTENSIONS
+from test_file_system import MoveAllTo
+from test_util import ReadFile
 
-TABS_SCHEMA_BRANCHES = {
+FAKE_TABS_IDL = '\n'.join([
+  '// Copyleft stuff.',
+  '',
+  '// Some description here.',
+  'namespace fakeTabs {',
+  '  dictionary WasImplicitlyInlinedType {};',
+  '  interface Functions {',
+  '    static void myFunc(WasImplicitlyInlinedType arg);',
+  '    static void anotherFunc(WasImplicitlyInlinedType arg);',
+  '  };',
+  '};'])
+
+FAKE_TABS_WITH_INLINING_IDL = '\n'.join([
+  '// Copyleft stuff.',
+  '',
+  '// Some description here.',
+  'namespace fakeTabs {',
+  '  dictionary WasImplicitlyInlinedType {};',
+  '  interface Functions {',
+  '    static void myFunc(WasImplicitlyInlinedType arg);',
+  '  };',
+  '};'])
+
+TABS_SCHEMA_BRANCHES = MoveAllTo(CHROME_EXTENSIONS, {
   'trunk': {
+    'docs': {
+      'templates': {
+        'json': {
+          'api_availabilities.json': '{}',
+          'intro_tables.json': '{}'
+        }
+      }
+    },
     'api': {
-      '_api_features.json': "{}",
+      '_api_features.json': json.dumps({
+        'tabs.scheduledFunc': {
+          'channel': 'stable'
+        }
+      }),
+      '_manifest_features.json': '{}',
+      '_permission_features.json': '{}',
+      'fake_tabs.idl': FAKE_TABS_IDL,
+      'tabs.json': json.dumps([{
+        'namespace': 'tabs',
+        'types': [
+          {
+            'id': 'Tab',
+            'type': 'any',
+            'properties': {
+              'url': {
+                'type': 'any'
+              },
+              'index': {
+                'type': 'any'
+              },
+              'selected': {
+                'type': 'any'
+              },
+              'id': {
+                'type': 'any'
+              },
+              'windowId': {
+                'type': 'any'
+              }
+            }
+          },
+          {
+            'id': 'InlinedType',
+            'type': 'any',
+            'inline_doc': True
+          },
+          {
+            'id': 'InjectDetails',
+            'type': 'any',
+            'properties': {
+              'allFrames': {
+                'type': 'any'
+              },
+              'code': {
+                'type': 'any'
+              },
+              'file': {
+                'type':'any'
+              }
+            }
+          },
+          {
+            'id': 'DeprecatedType',
+            'type': 'any',
+            'deprecated': 'This is deprecated'
+          }
+        ],
+        'properties': {
+          'fakeTabsProperty1': {
+            'type': 'any'
+          },
+          'fakeTabsProperty2': {
+            'type': 'any'
+          },
+          'fakeTabsProperty3': {
+            'type': 'any'
+          }
+        },
+        'functions': [
+          {
+            'name': 'getCurrent',
+            'parameters': [
+              {
+                'name': 'callback',
+                'type': 'function',
+                'parameters': [
+                  {
+                    'name': 'tab',
+                    'type': 'any'
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            'name': 'get',
+            'parameters': [
+              {
+                'name': 'callback',
+                'type': 'function',
+                'parameters': [
+                  {
+                    'name': 'tab',
+                    'type': 'any'
+                  }
+                ]
+              },
+              {
+                'name': 'tabId',
+                'type': 'any'
+              }
+            ]
+          },
+          {
+            'name': 'restrictedFunc'
+          },
+          {
+            'name': 'scheduledFunc',
+            'parameters': []
+          }
+        ],
+        'events': [
+          {
+            'name': 'onActivated',
+            'type': 'event',
+            'parameters': [
+              {
+                'name': 'activeInfo',
+                'type': 'any',
+                'properties': {
+                  'tabId': {
+                    'type': 'any'
+                  },
+                  'windowId': {
+                    'type': 'any'
+                  }
+                }
+              }
+            ]
+          },
+          {
+            'name': 'onUpdated',
+            'type': 'event',
+            'parameters': [
+              {
+                'name': 'tabId',
+                'type': 'any'
+              },
+              {
+                'name': 'tab',
+                'type': 'any'
+              },
+              {
+                'name': 'changeInfo',
+                'type': 'any',
+                'properties': {
+                  'pinned': {
+                    'type': 'any'
+                  },
+                  'status': {
+                    'type': 'any'
+                  }
+                }
+              }
+            ]
+          }
+        ]
+      }])
+    }
+  },
+  '1612': {
+    'api': {
+      '_api_features.json': json.dumps({
+        'tabs.scheduledFunc': {
+          'channel': 'stable'
+        }
+      }),
       '_manifest_features.json': "{}",
       '_permission_features.json': "{}",
+      'fake_tabs.idl': FAKE_TABS_IDL,
       'tabs.json': json.dumps([{
         'namespace': 'tabs',
         'types': [
@@ -31,12 +233,15 @@ TABS_SCHEMA_BRANCHES = {
               'code': {},
               'file': {}
             }
+          },
+          {
+            'id': 'DeprecatedType',
+            'deprecated': 'This is deprecated'
           }
         ],
         'properties': {
           'fakeTabsProperty1': {},
-          'fakeTabsProperty2': {},
-          'fakeTabsProperty3': {}
+          'fakeTabsProperty2': {}
         },
         'functions': [
           {
@@ -67,6 +272,13 @@ TABS_SCHEMA_BRANCHES = {
                 'name': 'tabId'
               }
             ]
+          },
+          {
+            'name': 'restrictedFunc'
+          },
+          {
+            'name': 'scheduledFunc',
+            'parameters': []
           }
         ],
         'events': [
@@ -104,11 +316,12 @@ TABS_SCHEMA_BRANCHES = {
       }])
     }
   },
-  '1500': {
+  '1599': {
     'api': {
       '_api_features.json': "{}",
       '_manifest_features.json': "{}",
       '_permission_features.json': "{}",
+      'fake_tabs.idl': FAKE_TABS_IDL,
       'tabs.json': json.dumps([{
         'namespace': 'tabs',
         'types': [
@@ -129,6 +342,10 @@ TABS_SCHEMA_BRANCHES = {
               'code': {},
               'file': {}
             }
+          },
+          {
+            'id': 'DeprecatedType',
+            'deprecated': 'This is deprecated'
           }
         ],
         'properties': {
@@ -164,6 +381,9 @@ TABS_SCHEMA_BRANCHES = {
                 'name': 'tabId'
               }
             ]
+          },
+          {
+            'name': 'restrictedFunc'
           }
         ],
         'events': [
@@ -174,7 +394,6 @@ TABS_SCHEMA_BRANCHES = {
                 'name': 'activeInfo',
                 'properties': {
                   'tabId': {},
-                  'windowId': {}
                 }
               }
             ]
@@ -186,9 +405,6 @@ TABS_SCHEMA_BRANCHES = {
                 'name': 'tabId'
               },
               {
-                'name': 'tab'
-              },
-              {
                 'name': 'changeInfo',
                 'properties': {
                   'pinned': {},
@@ -201,11 +417,16 @@ TABS_SCHEMA_BRANCHES = {
       }])
     }
   },
-  '1453': {
+  '1547': {
     'api': {
-      '_api_features.json': "{}",
+      '_api_features.json': json.dumps({
+        'tabs.restrictedFunc': {
+          'channel': 'dev'
+        }
+      }),
       '_manifest_features.json': "{}",
       '_permission_features.json': "{}",
+      'fake_tabs.idl': FAKE_TABS_IDL,
       'tabs.json': json.dumps([{
         'namespace': 'tabs',
         'types': [
@@ -226,6 +447,10 @@ TABS_SCHEMA_BRANCHES = {
               'code': {},
               'file': {}
             }
+          },
+          {
+            'id': 'DeprecatedType',
+            'deprecated': 'This is deprecated'
           }
         ],
         'properties': {
@@ -257,25 +482,178 @@ TABS_SCHEMA_BRANCHES = {
                   }
                 ]
               },
+            ]
+          },
+          {
+            'name': 'restrictedFunc'
+          }
+        ],
+        'events': [
+          {
+            'name': 'onUpdated',
+            'parameters': [
               {
                 'name': 'tabId'
+              },
+              {
+                'name': 'changeInfo',
+                'properties': {
+                  'pinned': {},
+                  'status': {}
+                }
               }
             ]
           }
+        ]
+      }])
+    }
+  },
+  '1500': {
+    'api': {
+      '_api_features.json': "{}",
+      '_manifest_features.json': "{}",
+      '_permission_features.json': "{}",
+      'fake_tabs.idl': FAKE_TABS_IDL,
+      'tabs.json': json.dumps([{
+        'namespace': 'tabs',
+        'types': [
+          {
+            'id': 'Tab',
+            'properties': {
+              'url': {},
+              'index': {},
+              'selected': {},
+              'id': {},
+              'windowId': {}
+            }
+          },
+          {
+            'id': 'InjectDetails',
+            'properties': {
+              'allFrames': {},
+            }
+          },
+          {
+            'id': 'DeprecatedType',
+            'deprecated': 'This is deprecated'
+          }
+        ],
+        'properties': {
+          'fakeTabsProperty1': {},
+          'fakeTabsProperty2': {}
+        },
+        'functions': [
+          {
+            'name': 'getCurrent',
+            'parameters': [
+              {
+                'name': 'callback',
+                'parameters': [
+                  {
+                    'name': 'tab'
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            'name': 'get',
+            'parameters': [
+              {
+                'name': 'callback',
+                'parameters': [
+                  {
+                    'name': 'tab'
+                  }
+                ]
+              },
+            ]
+          }
         ],
         'events': [
           {
-            'name': 'onActivated',
+            'name': 'onUpdated',
             'parameters': [
               {
-                'name': 'activeInfo',
+                'name': 'tabId'
+              },
+              {
+                'name': 'changeInfo',
                 'properties': {
-                  'tabId': {}
+                  'pinned': {},
+                  'status': {}
                 }
               }
             ]
+          }
+        ]
+      }])
+    }
+  },
+  '1453': {
+    'api': {
+      '_api_features.json': "{}",
+      '_manifest_features.json': "{}",
+      '_permission_features.json': "{}",
+      'fake_tabs.idl': FAKE_TABS_IDL,
+      'tabs.json': json.dumps([{
+        'namespace': 'tabs',
+        'types': [
+          {
+            'id': 'Tab',
+            'properties': {
+              'url': {},
+              'index': {},
+              'selected': {},
+              'id': {},
+              'windowId': {}
+            }
+          },
+          {
+            'id': 'InjectDetails',
+            'properties': {
+              'allFrames': {},
+            }
+          },
+          {
+            'id': 'DeprecatedType',
+            'deprecated': 'This is deprecated'
+          }
+        ],
+        'properties': {
+          'fakeTabsProperty1': {},
+          'fakeTabsProperty2': {}
+        },
+        'functions': [
+          {
+            'name': 'getCurrent',
+            'parameters': [
+              {
+                'name': 'callback',
+                'parameters': [
+                  {
+                    'name': 'tab'
+                  }
+                ]
+              }
+            ]
           },
           {
+            'name': 'get',
+            'parameters': [
+              {
+                'name': 'callback',
+                'parameters': [
+                  {
+                    'name': 'tab'
+                  }
+                ]
+              },
+            ]
+          }
+        ],
+        'events': [
+          {
             'name': 'onUpdated',
             'parameters': [
               {
@@ -298,6 +676,7 @@ TABS_SCHEMA_BRANCHES = {
     'api': {
       '_manifest_features.json': "{}",
       '_permission_features.json': "{}",
+      'fake_tabs.idl': FAKE_TABS_IDL,
       'tabs.json': json.dumps([{
         'namespace': 'tabs',
         'types': [
@@ -315,9 +694,11 @@ TABS_SCHEMA_BRANCHES = {
             'id': 'InjectDetails',
             'properties': {
               'allFrames': {},
-              'code': {},
-              'file': {}
             }
+          },
+          {
+            'id': 'DeprecatedType',
+            'deprecated': 'This is deprecated'
           }
         ],
         'properties': {
@@ -376,6 +757,7 @@ TABS_SCHEMA_BRANCHES = {
     'api': {
       '_manifest_features.json': "{}",
       '_permission_features.json': "{}",
+      'fake_tabs.idl': FAKE_TABS_WITH_INLINING_IDL,
       'tabs.json': json.dumps([{
         'namespace': 'tabs',
         'types': [
@@ -394,6 +776,9 @@ TABS_SCHEMA_BRANCHES = {
             'properties': {
               'allFrames': {}
             }
+          },
+          {
+            'id': 'DeprecatedType',
           }
         ],
         'properties': {
@@ -1105,4 +1490,4 @@ TABS_SCHEMA_BRANCHES = {
       'extension_api.json': "{}"
     }
   }
-}
+})