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

Unified Diff: tools/json_schema_compiler/js_externs_generator_test.py

Issue 1109793003: [Extern Generation] Normify extern enum property names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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: 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 b74260daf86e5fcc0932bdd79b6501d651356fe6..1c9f6478d136408710cbfff49678c16cd7b174ec 100755
--- a/tools/json_schema_compiler/js_externs_generator_test.py
+++ b/tools/json_schema_compiler/js_externs_generator_test.py
@@ -163,6 +163,12 @@ fake_json = """// Copyright 2014 The Chromium Authors. All rights reserved.
{
"namespace": "fakeJson",
"description": "Fake JSON API Stuff",
+ "types": [ {
+ "id": "CrazyEnum",
+ "type": "string",
+ "enum": ["camelCaseEnum", "Non-Characters", "5NumFirst", \
+"3Just-plainOld_MEAN"]
+ } ],
"functions": [ {
"name": "funcWithInlineObj",
"type": "function",
@@ -231,6 +237,17 @@ json_expected = """// Copyright %s The Chromium Authors. All rights reserved.
chrome.fakeJson = {};
/**
+ * @enum {string}
+ * @see https://developer.chrome.com/extensions/fakeJson#type-CrazyEnum
+ */
+chrome.fakeJson.CrazyEnum = {
+ CAMEL_CASE_ENUM: 'camelCaseEnum',
+ NON_CHARACTERS: 'Non-Characters',
+ _5NUM_FIRST: '5NumFirst',
+ _3JUST_PLAIN_OLD_MEAN: '3Just-plainOld_MEAN',
+};
+
+/**
* @param {{
* foo: (boolean|undefined),
* bar: number,

Powered by Google App Engine
This is Rietveld 408576698