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

Unified Diff: tools/json_schema_compiler/js_externs_generator_test.py

Issue 1036593004: [Extension API Extern Generation] Add support for function types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/json_schema_compiler/js_externs_generator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/js_externs_generator_test.py
diff --git a/tools/json_schema_compiler/js_externs_generator_test.py b/tools/json_schema_compiler/js_externs_generator_test.py
index 01cde1dc4b400b3a89aeb07c06cec68b1c70dde2..0d4160b52decb78162ab9190959a0e0687f56dda 100755
--- a/tools/json_schema_compiler/js_externs_generator_test.py
+++ b/tools/json_schema_compiler/js_externs_generator_test.py
@@ -46,10 +46,17 @@ namespace fakeApi {
callback VoidCallback = void();
+ callback BazGreekCallback = void(Baz baz, Greek greek);
+
interface Functions {
- // Does something exciting!
+ // Does something exciting! And what's more, this is a multiline function
+ // comment! It goes onto multiple lines!
// |baz| : The baz to use.
- static void doSomething(Baz baz, optional VoidCallback callback);
+ static void doSomething(Baz baz, VoidCallback callback);
+
+ static void bazGreek(optional BazGreekCallback callback);
+
+ [deprecated="Use a new method."] static DOMString returnString();
};
};
"""
@@ -102,11 +109,23 @@ var Bar;
var Baz;
/**
- * Does something exciting!
+ * Does something exciting! And what's more, this is a multiline function
+ * comment! It goes onto multiple lines!
* @param {Baz} baz The baz to use.
- * @param {Function=} callback
+ * @param {function():void} callback
*/
chrome.fakeApi.doSomething = function(baz, callback) {};
+
+/**
+ * @param {function(Baz, !chrome.fakeApi.Greek):void=} callback
+ */
+chrome.fakeApi.bazGreek = function(callback) {};
+
+/**
+ * @return {string}
+ * @deprecated Use a new method.
+ */
+chrome.fakeApi.returnString = function() {};
""" % datetime.now().year
« no previous file with comments | « tools/json_schema_compiler/js_externs_generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698