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

Unified Diff: chrome/common/extensions/docs/server2/availability_finder_test.py

Issue 344453003: Docserver: separate models for apps and extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase/Add comment Created 6 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/availability_finder_test.py
diff --git a/chrome/common/extensions/docs/server2/availability_finder_test.py b/chrome/common/extensions/docs/server2/availability_finder_test.py
index abe0556beafae7696ee8efb4a66305b69a01a264..3edf7ff76aed1143f56c467637be1e679e866fca 100755
--- a/chrome/common/extensions/docs/server2/availability_finder_test.py
+++ b/chrome/common/extensions/docs/server2/availability_finder_test.py
@@ -15,6 +15,7 @@ from fake_url_fetcher import FakeUrlFetcher
from host_file_system_iterator import HostFileSystemIterator
from mock_function import MockFunction
from object_store_creator import ObjectStoreCreator
+from platform_util import GetPlatforms
from test_data.canned_data import (CANNED_API_FILE_SYSTEM_DATA, CANNED_BRANCHES)
from test_data.object_level_availability.tabs import TABS_SCHEMA_BRANCHES
from test_util import Server2Path
@@ -24,27 +25,32 @@ TABS_UNMODIFIED_VERSIONS = (16, 20, 23, 24)
class AvailabilityFinderTest(unittest.TestCase):
+ def _create_availability_finder(self,
+ host_fs_creator,
+ host_fs_iterator,
+ platform):
+ test_object_store = ObjectStoreCreator.ForTest()
+ return AvailabilityFinder(
+ self._branch_utility,
+ CompiledFileSystem.Factory(test_object_store),
+ host_fs_iterator,
+ host_fs_creator.GetTrunk(),
+ test_object_store,
+ platform)
+
def setUp(self):
self._branch_utility = BranchUtility(
os.path.join('branch_utility', 'first.json'),
os.path.join('branch_utility', 'second.json'),
FakeUrlFetcher(Server2Path('test_data')),
ObjectStoreCreator.ForTest())
- api_fs_creator = FakeHostFileSystemProvider(CANNED_API_FILE_SYSTEM_DATA)
+ self._api_fs_creator = FakeHostFileSystemProvider(
+ CANNED_API_FILE_SYSTEM_DATA)
self._node_fs_creator = FakeHostFileSystemProvider(TABS_SCHEMA_BRANCHES)
-
- def create_availability_finder(host_fs_creator):
- test_object_store = ObjectStoreCreator.ForTest()
- return AvailabilityFinder(
- self._branch_utility,
- CompiledFileSystem.Factory(test_object_store),
- HostFileSystemIterator(host_fs_creator,
- self._branch_utility),
- host_fs_creator.GetTrunk(),
- test_object_store)
-
- self._avail_finder = create_availability_finder(api_fs_creator)
- self._node_avail_finder = create_availability_finder(self._node_fs_creator)
+ self._api_fs_iterator = HostFileSystemIterator(self._api_fs_creator,
+ self._branch_utility)
+ self._node_fs_iterator = HostFileSystemIterator(self._node_fs_creator,
+ self._branch_utility)
# Imitate the actual SVN file system by incrementing the stats for paths
# where an API schema has changed.
@@ -61,33 +67,36 @@ class AvailabilityFinderTest(unittest.TestCase):
# Use the HostFileSystemIterator created above to change global stat values
# for the TestFileSystems that it creates.
- self._node_avail_finder._file_system_iterator.Ascending(
+ self._node_fs_iterator.Ascending(
# The earliest version represented with the tabs' test data is 13.
self._branch_utility.GetStableChannelInfo(13),
stat_paths)
def testGraphOptimization(self):
- # Keep track of how many times the APISchemaGraph constructor is called.
- original_constructor = api_schema_graph.APISchemaGraph
- mock_constructor = MockFunction(original_constructor)
- api_schema_graph.APISchemaGraph = mock_constructor
-
- try:
- # The test data includes an extra branch where the API does not exist.
- num_versions = len(TABS_SCHEMA_BRANCHES) - 1
- # We expect an APISchemaGraph to be created only when an API schema file
- # has different stat data from the previous version's schema file.
- num_graphs_created = num_versions - len(TABS_UNMODIFIED_VERSIONS)
-
- # Run the logic for object-level availability for an API.
- self._node_avail_finder.GetAPINodeAvailability('tabs')
-
- self.assertTrue(*api_schema_graph.APISchemaGraph.CheckAndReset(
- num_graphs_created))
- finally:
- # Ensure that the APISchemaGraph constructor is reset to be the original
- # constructor.
- api_schema_graph.APISchemaGraph = original_constructor
+ for platform in GetPlatforms():
+ # Keep track of how many times the APISchemaGraph constructor is called.
+ original_constructor = api_schema_graph.APISchemaGraph
+ mock_constructor = MockFunction(original_constructor)
+ api_schema_graph.APISchemaGraph = mock_constructor
+
+ node_avail_finder = self._create_availability_finder(
+ self._node_fs_creator, self._node_fs_iterator, platform)
+ try:
+ # The test data includes an extra branch where the API does not exist.
+ num_versions = len(TABS_SCHEMA_BRANCHES) - 1
+ # We expect an APISchemaGraph to be created only when an API schema file
+ # has different stat data from the previous version's schema file.
+ num_graphs_created = num_versions - len(TABS_UNMODIFIED_VERSIONS)
+
+ # Run the logic for object-level availability for an API.
+ node_avail_finder.GetAPINodeAvailability('tabs')
+
+ self.assertTrue(*api_schema_graph.APISchemaGraph.CheckAndReset(
+ num_graphs_created))
+ finally:
+ # Ensure that the APISchemaGraph constructor is reset to be the original
+ # constructor.
+ api_schema_graph.APISchemaGraph = original_constructor
def testGetAPIAvailability(self):
# Key: Using 'channel' (i.e. 'beta') to represent an availability listing
@@ -95,229 +104,196 @@ class AvailabilityFinderTest(unittest.TestCase):
# represent the development channel, or phase of development, where an API's
# availability is being checked.
+ def assertGet(ch_info, api, only_on=None, scheduled=None):
+ for platform in GetPlatforms():
+ get_availability = self._create_availability_finder(
+ self._api_fs_creator,
+ self._api_fs_iterator,
+ platform if only_on is None else only_on).GetAPIAvailability
+ self.assertEqual(AvailabilityInfo(ch_info, scheduled=scheduled),
+ get_availability(api))
+
# Testing APIs with predetermined availability.
- self.assertEqual(
- AvailabilityInfo(ChannelInfo('trunk', 'trunk', 'trunk')),
- self._avail_finder.GetAPIAvailability('jsonTrunkAPI'))
- self.assertEqual(
- AvailabilityInfo(ChannelInfo('dev', CANNED_BRANCHES[28], 28)),
- self._avail_finder.GetAPIAvailability('jsonDevAPI'))
- self.assertEqual(
- AvailabilityInfo(ChannelInfo('beta', CANNED_BRANCHES[27], 27)),
- self._avail_finder.GetAPIAvailability('jsonBetaAPI'))
- self.assertEqual(
- AvailabilityInfo(ChannelInfo('stable', CANNED_BRANCHES[20], 20)),
- self._avail_finder.GetAPIAvailability('jsonStableAPI'))
+ assertGet(ChannelInfo('trunk', 'trunk', 'trunk'), 'jsonTrunkAPI')
+ assertGet(ChannelInfo('dev', CANNED_BRANCHES[28], 28), 'jsonDevAPI')
+ assertGet(ChannelInfo('beta', CANNED_BRANCHES[27], 27), 'jsonBetaAPI')
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[20], 20), 'jsonStableAPI')
# Testing a whitelisted API.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('beta', CANNED_BRANCHES[27], 27)),
- self._avail_finder.GetAPIAvailability('declarativeWebRequest'))
+ assertGet(ChannelInfo('beta', CANNED_BRANCHES[27], 27),
+ 'declarativeWebRequest')
# Testing APIs found only by checking file system existence.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('stable', CANNED_BRANCHES[23], 23)),
- self._avail_finder.GetAPIAvailability('windows'))
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('stable', CANNED_BRANCHES[18], 18)),
- self._avail_finder.GetAPIAvailability('tabs'))
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('stable', CANNED_BRANCHES[18], 18)),
- self._avail_finder.GetAPIAvailability('input.ime'))
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[23], 23), 'windows')
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[18], 18), 'tabs')
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[18], 18), 'input.ime')
# Testing API channel existence for _api_features.json.
# Listed as 'dev' on |beta|, 'dev' on |dev|.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('dev', CANNED_BRANCHES[28], 28)),
- self._avail_finder.GetAPIAvailability('systemInfo.stuff'))
+ assertGet(ChannelInfo('dev', CANNED_BRANCHES[28], 28), 'systemInfo.stuff')
# Listed as 'stable' on |beta|.
- self.assertEquals(
- AvailabilityInfo(
- ChannelInfo('beta', CANNED_BRANCHES[27], 27),
- scheduled=28),
- self._avail_finder.GetAPIAvailability('systemInfo.cpu'))
+ assertGet(ChannelInfo('beta', CANNED_BRANCHES[27], 27),
+ 'systemInfo.cpu',
+ scheduled=28)
# Testing API channel existence for _manifest_features.json.
# Listed as 'trunk' on all channels.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('trunk', 'trunk', 'trunk')),
- self._avail_finder.GetAPIAvailability('sync'))
+ assertGet(ChannelInfo('trunk', 'trunk', 'trunk'), 'sync')
# No records of API until |trunk|.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('trunk', 'trunk', 'trunk')),
- self._avail_finder.GetAPIAvailability('history'))
+ assertGet(ChannelInfo('trunk', 'trunk', 'trunk'), 'history')
# Listed as 'dev' on |dev|.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('dev', CANNED_BRANCHES[28], 28)),
- self._avail_finder.GetAPIAvailability('storage'))
+ assertGet(ChannelInfo('dev', CANNED_BRANCHES[28], 28), 'storage')
# Stable in _manifest_features and into pre-18 versions.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('stable', CANNED_BRANCHES[8], 8)),
- self._avail_finder.GetAPIAvailability('pageAction'))
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[8], 8), 'pageAction')
# Testing API channel existence for _permission_features.json.
# Listed as 'beta' on |trunk|.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('trunk', 'trunk', 'trunk')),
- self._avail_finder.GetAPIAvailability('falseBetaAPI'))
+ assertGet(ChannelInfo('trunk', 'trunk', 'trunk'), 'falseBetaAPI')
# Listed as 'trunk' on |trunk|.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('trunk', 'trunk', 'trunk')),
- self._avail_finder.GetAPIAvailability('trunkAPI'))
+ assertGet(ChannelInfo('trunk', 'trunk', 'trunk'), 'trunkAPI')
# Listed as 'trunk' on all development channels.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('trunk', 'trunk', 'trunk')),
- self._avail_finder.GetAPIAvailability('declarativeContent'))
+ assertGet(ChannelInfo('trunk', 'trunk', 'trunk'), 'declarativeContent')
# Listed as 'dev' on all development channels.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('dev', CANNED_BRANCHES[28], 28)),
- self._avail_finder.GetAPIAvailability('bluetooth'))
+ assertGet(ChannelInfo('dev', CANNED_BRANCHES[28], 28), 'bluetooth')
# Listed as 'dev' on |dev|.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('dev', CANNED_BRANCHES[28], 28)),
- self._avail_finder.GetAPIAvailability('cookies'))
+ assertGet(ChannelInfo('dev', CANNED_BRANCHES[28], 28), 'cookies')
# Treated as 'stable' APIs.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('stable', CANNED_BRANCHES[24], 24)),
- self._avail_finder.GetAPIAvailability('alarms'))
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('stable', CANNED_BRANCHES[21], 21)),
- self._avail_finder.GetAPIAvailability('bookmarks'))
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[24], 24), 'alarms')
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[21], 21), 'bookmarks')
# Testing older API existence using extension_api.json.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('stable', CANNED_BRANCHES[6], 6)),
- self._avail_finder.GetAPIAvailability('menus'))
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('stable', CANNED_BRANCHES[5], 5)),
- self._avail_finder.GetAPIAvailability('idle'))
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[6], 6), 'menus')
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[5], 5), 'idle')
# Switches between _features.json files across branches.
# Listed as 'trunk' on all channels, in _api, _permission, or _manifest.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('trunk', 'trunk', 'trunk')),
- self._avail_finder.GetAPIAvailability('contextMenus'))
+ assertGet(ChannelInfo('trunk', 'trunk', 'trunk'), 'contextMenus')
# Moves between _permission and _manifest as file system is traversed.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('stable', CANNED_BRANCHES[23], 23)),
- self._avail_finder.GetAPIAvailability('systemInfo.display'))
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('stable', CANNED_BRANCHES[17], 17)),
- self._avail_finder.GetAPIAvailability('webRequest'))
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[23], 23),
+ 'systemInfo.display')
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[17], 17), 'webRequest')
# Mid-upgrade cases:
# Listed as 'dev' on |beta| and 'beta' on |dev|.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('dev', CANNED_BRANCHES[28], 28)),
- self._avail_finder.GetAPIAvailability('notifications'))
- # Listed as 'beta' on |stable|, 'dev' on |beta| ... until |stable| on trunk.
- self.assertEquals(
- AvailabilityInfo(ChannelInfo('trunk', 'trunk', 'trunk')),
- self._avail_finder.GetAPIAvailability('events'))
+ assertGet(ChannelInfo('dev', CANNED_BRANCHES[28], 28), 'notifications')
+ # Listed as 'beta' on |stable|, 'dev' on |beta|...until |stable| on trunk.
+ assertGet(ChannelInfo('trunk', 'trunk', 'trunk'), 'events')
+
+ # Check for differing availability across apps|extensions
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[26], 26),
+ 'appsFirst',
+ only_on='extensions')
+ assertGet(ChannelInfo('stable', CANNED_BRANCHES[25], 25),
+ 'appsFirst',
+ only_on='apps')
def testGetAPINodeAvailability(self):
# Allow the LookupResult constructions below to take just one line.
- lookup_result = api_schema_graph.LookupResult
- availability_graph = self._node_avail_finder.GetAPINodeAvailability('tabs')
-
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetChannelInfo('trunk')),
- availability_graph.Lookup('tabs', 'properties',
- 'fakeTabsProperty3'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetChannelInfo('dev')),
- availability_graph.Lookup('tabs', 'events', 'onActivated',
- 'parameters', 'activeInfo', 'properties',
- 'windowId'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetChannelInfo('dev')),
- availability_graph.Lookup('tabs', 'events', 'onUpdated', 'parameters',
- 'tab'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetChannelInfo('beta')),
- availability_graph.Lookup('tabs', 'events','onActivated'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetChannelInfo('beta')),
- availability_graph.Lookup('tabs', 'functions', 'get', 'parameters',
- 'tabId'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetChannelInfo('stable')),
- availability_graph.Lookup('tabs', 'types', 'InjectDetails',
- 'properties', 'code'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetChannelInfo('stable')),
- availability_graph.Lookup('tabs', 'types', 'InjectDetails',
- 'properties', 'file'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetStableChannelInfo(25)),
- availability_graph.Lookup('tabs', 'types', 'InjectDetails'))
-
- # Nothing new in version 24 or 23.
-
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetStableChannelInfo(22)),
- availability_graph.Lookup('tabs', 'types', 'Tab', 'properties',
- 'windowId'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetStableChannelInfo(21)),
- availability_graph.Lookup('tabs', 'types', 'Tab', 'properties',
- 'selected'))
-
- # Nothing new in version 20.
-
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetStableChannelInfo(19)),
- availability_graph.Lookup('tabs', 'functions', 'getCurrent'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetStableChannelInfo(18)),
- availability_graph.Lookup('tabs', 'types', 'Tab', 'properties',
- 'index'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetStableChannelInfo(17)),
- availability_graph.Lookup('tabs', 'events', 'onUpdated', 'parameters',
- 'changeInfo'))
-
- # Nothing new in version 16.
-
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetStableChannelInfo(15)),
- availability_graph.Lookup('tabs', 'properties',
- 'fakeTabsProperty2'))
-
- # Everything else is available at the API's release, version 14 here.
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetStableChannelInfo(14)),
- availability_graph.Lookup('tabs', 'types', 'Tab'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetStableChannelInfo(14)),
- availability_graph.Lookup('tabs', 'types', 'Tab',
- 'properties', 'url'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetStableChannelInfo(14)),
- availability_graph.Lookup('tabs', 'properties',
- 'fakeTabsProperty1'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetStableChannelInfo(14)),
- availability_graph.Lookup('tabs', 'functions', 'get', 'parameters',
- 'callback'))
- self.assertEquals(
- lookup_result(True, self._branch_utility.GetStableChannelInfo(14)),
- availability_graph.Lookup('tabs', 'events', 'onUpdated'))
-
- # Test things that aren't available.
- self.assertEqual(lookup_result(False, None),
- availability_graph.Lookup('tabs', 'types',
- 'UpdateInfo'))
- self.assertEqual(lookup_result(False, None),
- availability_graph.Lookup('tabs', 'functions', 'get',
- 'parameters', 'callback',
- 'parameters', 'tab', 'id'))
- self.assertEqual(lookup_result(False, None),
- availability_graph.Lookup('functions'))
- self.assertEqual(lookup_result(False, None),
- availability_graph.Lookup('events', 'onActivated',
- 'parameters', 'activeInfo',
- 'tabId'))
+ for platform in GetPlatforms():
+ lookup_result = api_schema_graph.LookupResult
+ availability_graph = self._create_availability_finder(
+ self._node_fs_creator,
+ self._node_fs_iterator,
+ platform).GetAPINodeAvailability('tabs')
+
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetChannelInfo('trunk')),
+ availability_graph.Lookup('tabs', 'properties',
+ 'fakeTabsProperty3'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetChannelInfo('dev')),
+ availability_graph.Lookup('tabs', 'events', 'onActivated',
+ 'parameters', 'activeInfo', 'properties',
+ 'windowId'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetChannelInfo('dev')),
+ availability_graph.Lookup('tabs', 'events', 'onUpdated', 'parameters',
+ 'tab'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetChannelInfo('beta')),
+ availability_graph.Lookup('tabs', 'events','onActivated'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetChannelInfo('beta')),
+ availability_graph.Lookup('tabs', 'functions', 'get', 'parameters',
+ 'tabId'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetChannelInfo('stable')),
+ availability_graph.Lookup('tabs', 'types', 'InjectDetails',
+ 'properties', 'code'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetChannelInfo('stable')),
+ availability_graph.Lookup('tabs', 'types', 'InjectDetails',
+ 'properties', 'file'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetStableChannelInfo(25)),
+ availability_graph.Lookup('tabs', 'types', 'InjectDetails'))
+
+ # Nothing new in version 24 or 23.
+
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetStableChannelInfo(22)),
+ availability_graph.Lookup('tabs', 'types', 'Tab', 'properties',
+ 'windowId'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetStableChannelInfo(21)),
+ availability_graph.Lookup('tabs', 'types', 'Tab', 'properties',
+ 'selected'))
+
+ # Nothing new in version 20.
+
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetStableChannelInfo(19)),
+ availability_graph.Lookup('tabs', 'functions', 'getCurrent'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetStableChannelInfo(18)),
+ availability_graph.Lookup('tabs', 'types', 'Tab', 'properties',
+ 'index'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetStableChannelInfo(17)),
+ availability_graph.Lookup('tabs', 'events', 'onUpdated', 'parameters',
+ 'changeInfo'))
+
+ # Nothing new in version 16.
+
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetStableChannelInfo(15)),
+ availability_graph.Lookup('tabs', 'properties',
+ 'fakeTabsProperty2'))
+
+ # Everything else is available at the API's release, version 14 here.
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetStableChannelInfo(14)),
+ availability_graph.Lookup('tabs', 'types', 'Tab'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetStableChannelInfo(14)),
+ availability_graph.Lookup('tabs', 'types', 'Tab',
+ 'properties', 'url'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetStableChannelInfo(14)),
+ availability_graph.Lookup('tabs', 'properties',
+ 'fakeTabsProperty1'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetStableChannelInfo(14)),
+ availability_graph.Lookup('tabs', 'functions', 'get', 'parameters',
+ 'callback'))
+ self.assertEquals(
+ lookup_result(True, self._branch_utility.GetStableChannelInfo(14)),
+ availability_graph.Lookup('tabs', 'events', 'onUpdated'))
+
+ # Test things that aren't available.
+ self.assertEqual(lookup_result(False, None),
+ availability_graph.Lookup('tabs', 'types',
+ 'UpdateInfo'))
+ self.assertEqual(lookup_result(False, None),
+ availability_graph.Lookup('tabs', 'functions', 'get',
+ 'parameters', 'callback',
+ 'parameters', 'tab', 'id'))
+ self.assertEqual(lookup_result(False, None),
+ availability_graph.Lookup('functions'))
+ self.assertEqual(lookup_result(False, None),
+ availability_graph.Lookup('events', 'onActivated',
+ 'parameters', 'activeInfo',
+ 'tabId'))
if __name__ == '__main__':
« no previous file with comments | « chrome/common/extensions/docs/server2/availability_finder.py ('k') | chrome/common/extensions/docs/server2/build_server.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698