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

Unified Diff: headless/lib/browser/client_api_generator_unittest.py

Issue 2278123002: headless: Ensure all commands have parameters and return types (Closed)
Patch Set: Created 4 years, 4 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 | « headless/lib/browser/client_api_generator.py ('k') | headless/lib/browser/domain_cc.template » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/browser/client_api_generator_unittest.py
diff --git a/headless/lib/browser/client_api_generator_unittest.py b/headless/lib/browser/client_api_generator_unittest.py
index cf101d35a7a7e4e7bd9eb654242782b7bb8f1a5d..d9d3f81dea79e90435920ddd0aa04af68bbb46b4 100644
--- a/headless/lib/browser/client_api_generator_unittest.py
+++ b/headless/lib/browser/client_api_generator_unittest.py
@@ -370,37 +370,13 @@ class ClientApiGeneratorTest(unittest.TestCase):
}
]
}
- expected_types = [
- {
- 'type': 'object',
- 'id': 'FooCommandParams',
- 'description': 'Parameters for the FooCommand command.',
- 'properties': [],
- },
- {
- 'type': 'object',
- 'id': 'FooCommandResult',
- 'description': 'Result for the FooCommand command.',
- 'properties': [],
- },
- {
- 'type': 'object',
- 'id': 'BarEventParams',
- 'description': 'Parameters for the BarEvent event.',
- 'properties': [],
- }
- ]
client_api_generator.PatchExperimentalCommandsAndEvents(json_api)
- client_api_generator.SynthesizeCommandTypes(json_api)
- client_api_generator.SynthesizeEventTypes(json_api)
for command in json_api['domains'][0]['commands']:
self.assertTrue(command['experimental'])
for event in json_api['domains'][0]['events']:
self.assertTrue(command['experimental'])
- types = json_api['domains'][0]['types']
- self.assertListEqual(types, expected_types)
- def test_PatchExperimentalCommandsAndEvents(self):
+ def test_EnsureCommandsHaveParametersAndReturnTypes(self):
json_api = {
'domains': [
{
@@ -408,13 +384,11 @@ class ClientApiGeneratorTest(unittest.TestCase):
'commands': [
{
'name': 'FooCommand',
- 'experimental': True,
}
],
'events': [
{
'name': 'BarEvent',
- 'experimental': True,
}
]
}
@@ -440,13 +414,9 @@ class ClientApiGeneratorTest(unittest.TestCase):
'properties': [],
}
]
- client_api_generator.PatchExperimentalCommandsAndEvents(json_api)
+ client_api_generator.EnsureCommandsHaveParametersAndReturnTypes(json_api)
client_api_generator.SynthesizeCommandTypes(json_api)
client_api_generator.SynthesizeEventTypes(json_api)
- for command in json_api['domains'][0]['commands']:
- self.assertTrue(command['experimental'])
- for event in json_api['domains'][0]['events']:
- self.assertTrue(command['experimental'])
types = json_api['domains'][0]['types']
self.assertListEqual(types, expected_types)
« no previous file with comments | « headless/lib/browser/client_api_generator.py ('k') | headless/lib/browser/domain_cc.template » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698