summaryrefslogtreecommitdiffstats
path: root/tools/json_schema_compiler
diff options
context:
space:
mode:
authorscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-12 00:09:28 +0000
committerscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-12 00:09:28 +0000
commitb810ed751289fab5f0f0c757c46c9ab8c7a3027a (patch)
treed34f95cec4b22ea96f37d4d8cb3c8243a970b950 /tools/json_schema_compiler
parenta17df8e38de1dd7ecc68f3bdf7a9c87bb2410e16 (diff)
downloadchromium_src-b810ed751289fab5f0f0c757c46c9ab8c7a3027a.zip
chromium_src-b810ed751289fab5f0f0c757c46c9ab8c7a3027a.tar.gz
chromium_src-b810ed751289fab5f0f0c757c46c9ab8c7a3027a.tar.bz2
windowCreateWindowOptions.type changed to enum; nodoc support on idl enum.
Issue 181295: chrome.app.window.CreateWindowOptions.type should be an enum. This allows runtime parameter checking to be automated, and simplifies the runtime logic check in custom code. Because this enum should not be documented, this issue is fixed: Issue 176599: JSON schema compiler supporting nodoc for enum types. idl_schema.py required detecting this property on enums. BUG=181295, 176599 TEST=http://developer.chrome.com/apps/app.window.html does not contain string 'WindowType'. Review URL: https://chromiumcodereview.appspot.com/12717005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187418 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/json_schema_compiler')
-rw-r--r--tools/json_schema_compiler/idl_schema.py5
-rwxr-xr-xtools/json_schema_compiler/idl_schema_test.py6
-rw-r--r--tools/json_schema_compiler/test/idl_basics.idl5
3 files changed, 14 insertions, 2 deletions
diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py
index 8c1bc76..4c79c30 100644
--- a/tools/json_schema_compiler/idl_schema.py
+++ b/tools/json_schema_compiler/idl_schema.py
@@ -295,8 +295,9 @@ class Enum(object):
'description': self.description,
'type': 'string',
'enum': enum}
- if self.node.GetProperty('inline_doc'):
- result['inline_doc'] = True
+ for property_name in ('inline_doc', 'nodoc'):
+ if self.node.GetProperty(property_name):
+ result[property_name] = True
return result
diff --git a/tools/json_schema_compiler/idl_schema_test.py b/tools/json_schema_compiler/idl_schema_test.py
index 26a382a..6adbbd7 100755
--- a/tools/json_schema_compiler/idl_schema_test.py
+++ b/tools/json_schema_compiler/idl_schema_test.py
@@ -93,6 +93,12 @@ class IdlSchemaTest(unittest.TestCase):
self.assertTrue(func is not None)
self.assertTrue(func['nocompile'])
+ def testNoDocOnEnum(self):
+ schema = self.idl_basics
+ enum_with_nodoc = getType(schema, 'EnumTypeWithNoDoc')
+ self.assertTrue(enum_with_nodoc is not None)
+ self.assertTrue(enum_with_nodoc['nodoc'])
+
def testInternalNamespace(self):
idl_basics = self.idl_basics
self.assertEquals('idl_basics', idl_basics['namespace'])
diff --git a/tools/json_schema_compiler/test/idl_basics.idl b/tools/json_schema_compiler/test/idl_basics.idl
index 0fa9b43..08d369c 100644
--- a/tools/json_schema_compiler/test/idl_basics.idl
+++ b/tools/json_schema_compiler/test/idl_basics.idl
@@ -11,6 +11,11 @@
name2
};
+ [nodoc] enum EnumTypeWithNoDoc {
+ name1,
+ name2
+ };
+
dictionary MyType1 {
// This comment tests "double-quotes".
[legalValues=(1,2)] long x;