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

Side by Side Diff: tools/json_schema_compiler/js_externs_generator_test.py

Issue 2768213002: [Closure Externs] Add wrapping parens on optional params (Closed)
Patch Set: . Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/json_schema_compiler/js_util.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import idl_schema 6 import idl_schema
7 import json_parse 7 import json_parse
8 from js_externs_generator import JsExternsGenerator 8 from js_externs_generator import JsExternsGenerator
9 from datetime import datetime 9 from datetime import datetime
10 import model 10 import model
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 chrome.fakeApi.bazGreek = function(callback) {}; 202 chrome.fakeApi.bazGreek = function(callback) {};
203 203
204 /** 204 /**
205 * @return {string} 205 * @return {string}
206 * @deprecated Use a new method. 206 * @deprecated Use a new method.
207 * @see https://developer.chrome.com/extensions/fakeApi#method-returnString 207 * @see https://developer.chrome.com/extensions/fakeApi#method-returnString
208 */ 208 */
209 chrome.fakeApi.returnString = function() {}; 209 chrome.fakeApi.returnString = function() {};
210 210
211 /** 211 /**
212 * @param {function(!chrome.fakeApi.Qux|undefined):void=} callback 212 * @param {function((!chrome.fakeApi.Qux|undefined)):void=} callback
213 * @see https://developer.chrome.com/extensions/fakeApi#method-optionalParam 213 * @see https://developer.chrome.com/extensions/fakeApi#method-optionalParam
214 */ 214 */
215 chrome.fakeApi.optionalParam = function(callback) {}; 215 chrome.fakeApi.optionalParam = function(callback) {};
216 216
217 /** 217 /**
218 * Fired when we realize it's a trap! 218 * Fired when we realize it's a trap!
219 * @type {!ChromeEvent} 219 * @type {!ChromeEvent}
220 * @see https://developer.chrome.com/extensions/fakeApi#event-onTrapDetected 220 * @see https://developer.chrome.com/extensions/fakeApi#event-onTrapDetected
221 */ 221 */
222 chrome.fakeApi.onTrapDetected;""" % (datetime.now().year, sys.argv[0])) 222 chrome.fakeApi.onTrapDetected;""" % (datetime.now().year, sys.argv[0]))
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 JsExternsGenerator().Generate(namespace).Render()) 365 JsExternsGenerator().Generate(namespace).Render())
366 366
367 def testJsonWithInlineObjects(self): 367 def testJsonWithInlineObjects(self):
368 namespace = self._GetNamespace(fake_json, 'fake_api.json', False) 368 namespace = self._GetNamespace(fake_json, 'fake_api.json', False)
369 self.assertMultiLineEqual(json_expected, 369 self.assertMultiLineEqual(json_expected,
370 JsExternsGenerator().Generate(namespace).Render()) 370 JsExternsGenerator().Generate(namespace).Render())
371 371
372 372
373 if __name__ == '__main__': 373 if __name__ == '__main__':
374 unittest.main() 374 unittest.main()
OLDNEW
« no previous file with comments | « no previous file | tools/json_schema_compiler/js_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698