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

Unified Diff: chrome/common/extensions/docs/server2/api_data_source_test.py

Issue 14322003: Inline docs render properly in extensions doc server. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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: chrome/common/extensions/docs/server2/api_data_source_test.py
diff --git a/chrome/common/extensions/docs/server2/api_data_source_test.py b/chrome/common/extensions/docs/server2/api_data_source_test.py
index 0f3d43855cf20136f40ac864eb5da939c4e0994c..193b5b055ffe366bb3573e9841ede4d34ac8500c 100755
--- a/chrome/common/extensions/docs/server2/api_data_source_test.py
+++ b/chrome/common/extensions/docs/server2/api_data_source_test.py
@@ -18,6 +18,8 @@ from in_memory_object_store import InMemoryObjectStore
from local_file_system import LocalFileSystem
from object_store_creator import ObjectStoreCreator
from reference_resolver import ReferenceResolver
+import third_party.json_schema_compiler.idl_schema as idl_schema
+import third_party.json_schema_compiler.idl_parser as idl_parser
import third_party.json_schema_compiler.model as model
def _MakeLink(href, text):
@@ -136,5 +138,18 @@ class APIDataSourceTest(unittest.TestCase):
_RemoveNoDocs(d)
self.assertEqual(self._LoadJSON('expected_nodoc.json'), d)
+ def testInlineDocs(self):
+ with open(os.path.join(sys.path[0], 'test_data/test_idl/inline.idl')) as f:
cduvall 2013/04/18 00:02:41 I would make a _ReadLocalIDLFile and _ReadLocalJSO
jshumway 2013/04/18 01:14:19 Generalized read local file with a default argumen
+ idl = idl_parser.IDLParser().ParseData(f.read())
+
+ jsc = _JSCModel(
+ idl_schema.IDLSchema(idl).process()[0],
+ None, True).ToDict()
+
+ self.assertNotEqual(
+ jsc['functions'][0]['parameters'][0].get('enum_values'),
+ None)
+
+
if __name__ == '__main__':
unittest.main()

Powered by Google App Engine
This is Rietveld 408576698