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

Unified Diff: extensions/test/data/mojo_private_unittest.js

Issue 862793003: Expose requireAsync method and make it more robust (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync with master Created 5 years, 11 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 | « extensions/renderer/resources/mojo_private_custom_bindings.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/test/data/mojo_private_unittest.js
diff --git a/extensions/test/data/mojo_private_unittest.js b/extensions/test/data/mojo_private_unittest.js
index 2a90d6509240d2cda449aa21a6633784efe43a0b..74e1486a22bea88d161d3551d8f3dea4bed374f4 100644
--- a/extensions/test/data/mojo_private_unittest.js
+++ b/extensions/test/data/mojo_private_unittest.js
@@ -31,4 +31,25 @@ unittestBindings.exportTests([
mojoPrivate.define('testModule', ['does not exist!'], test.fail);
test.succeed();
},
+
+ function testRequireAsync() {
+ console.log('requireAsync');
+ mojoPrivate.requireAsync('mojo/public/js/codec').then(
+ test.callbackPass(function(codec) {
+ test.assertEq('function', typeof codec.Message);
+ }));
+ },
+
+ function testDefineAndRequire() {
+ mojoPrivate.define('testModule', ['dependency'],
+ test.callbackPass(function(module) {
+ test.assertEq(12345, module.result);
+ mojoPrivate.requireAsync('dependency').then(
Sam McNally 2015/01/27 04:06:28 Does this need to be inside a define()ed module?
Kevin M 2015/01/27 18:10:09 Done.
+ test.succeed,
Sam McNally 2015/01/27 04:06:28 test.callbackPass()
Kevin M 2015/01/27 18:10:09 Done.
+ test.fail);
+ }));
+ mojoPrivate.define('dependency', test.callbackPass(function() {
+ return {result: 12345};
+ }));
+ }
], test.runTests, exports);
« no previous file with comments | « extensions/renderer/resources/mojo_private_custom_bindings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698