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

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

Issue 389433002: Docserver: Add more tests to api_data_source_test.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/api_data_source_test.py
diff --git a/chrome/common/extensions/docs/server2/api_data_source_test.py b/chrome/common/extensions/docs/server2/api_data_source_test.py
index 3d0d7b8275125dce61c138c807cb8471ddd00ead..67795595ffc00f71c9168486f575dc42d219435b 100755
--- a/chrome/common/extensions/docs/server2/api_data_source_test.py
+++ b/chrome/common/extensions/docs/server2/api_data_source_test.py
@@ -323,8 +323,14 @@ class APIDataSourceWithNodeAvailabilityTest(unittest.TestCase):
def testGetAPINodeAvailability(self):
def assertEquals(node, actual):
node_availabilities = {
+ 'tabs.Tab': None,
+ 'tabs.fakeTabsProperty1': None,
'tabs.get': None,
- 'tabs.getCurrent': 19
+ 'tabs.onUpdated': None,
+ 'tabs.InjectDetails': 25,
+ 'tabs.fakeTabsProperty2': 15,
+ 'tabs.getCurrent': 19,
+ 'tabs.onActivated': 27
}
self.assertEquals(node_availabilities[node], actual)
@@ -337,10 +343,31 @@ class APIDataSourceWithNodeAvailabilityTest(unittest.TestCase):
None).ToDict()
# Test nodes that have the same availability as their parent.
+
+ # Test type.
+ assertEquals('tabs.Tab', model_dict['types'][0]['availability'])
+ # Test property.
+ assertEquals('tabs.fakeTabsProperty1',
+ model_dict['properties'][0]['availability'])
+ # Test function.
assertEquals('tabs.get', model_dict['functions'][1]['availability'])
+ # Test event.
+ assertEquals('tabs.onUpdated', model_dict['events'][1]['availability'])
+
# Test nodes with varying availabilities.
+
+ # Test type.
+ assertEquals('tabs.InjectDetails',
+ model_dict['types'][1]['availability']['version'])
+ # Test property.
+ assertEquals('tabs.fakeTabsProperty2',
+ model_dict['properties'][2]['availability']['version'])
+ # Test function.
assertEquals('tabs.getCurrent',
model_dict['functions'][0]['availability']['version'])
+ # Test event.
+ assertEquals('tabs.onActivated',
+ model_dict['events'][0]['availability']['version'])
if __name__ == '__main__':
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698