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

Unified Diff: tools/json_schema_compiler/js_externs_generator_test.py

Issue 1034553003: [Extension API Extern Generation] Fix array, choices specification (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 4cd294e300ffa4c475d0a41403b8d1ab260cc832..390bd9bd04fc2c772736750b0a35f9d17b2a2443 100755
--- a/tools/json_schema_compiler/js_externs_generator_test.py
+++ b/tools/json_schema_compiler/js_externs_generator_test.py
@@ -34,8 +34,11 @@ namespace fakeApi {
boolean b;
Greek letter;
long[] arr;
+ Bar[]? optionalObjArr;
+ Greek[] enumArr;
Bar obj;
long? maybe;
+ (DOMString or Greek or long[]) choice;
};
callback VoidCallback = void();
@@ -83,9 +86,12 @@ var Bar;
* num: number,
* b: boolean,
* letter: chrome.fakeApi.Greek,
- * arr: Array,
+ * arr: !Array<number>,
+ * optionalObjArr: (!Array<Bar>|undefined),
+ * enumArr: !Array<chrome.fakeApi.Greek>,
Tyler Breisacher (Chromium) 2015/03/24 22:45:03 should this be !Array<!chrome.fakeApi.Greek> ?
Devlin 2015/03/24 23:10:37 Yes, I suppose that makes sense, as long as we mai
* obj: Bar,
- * maybe: (number|undefined)
+ * maybe: (number|undefined),
+ * choice: (string|chrome.fakeApi.Greek|!Array<number>)
Tyler Breisacher (Chromium) 2015/03/24 22:45:03 (string|!chrome.fakeApi.Greek|!Array<number>) ?
Devlin 2015/03/24 23:10:37 Done.
* }}
*/
var Baz;
@@ -100,12 +106,13 @@ chrome.fakeApi.doSomething = function(baz, callback) {};
class JsExternGeneratorTest(unittest.TestCase):
def testBasic(self):
+ self.maxDiff = None # Lets us see the full diff when inequal.
filename = 'fake_api.idl'
api_def = idl_schema.Process(fake_idl, filename)
m = model.Model()
namespace = m.AddNamespace(api_def[0], filename)
- self.assertEquals(expected_output,
- JsExternsGenerator().Generate(namespace).Render())
+ self.assertMultiLineEqual(expected_output,
+ JsExternsGenerator().Generate(namespace).Render())
if __name__ == '__main__':
unittest.main()
« 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