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

Unified Diff: mojo/edk/js/tests/interface_ptr_tests.js

Issue 2578333002: Mojo JS bindings: BindingSet support. (Closed)
Patch Set: Created 4 years 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 | « mojo/edk/js/tests/binding_tests.js ('k') | mojo/edk/js/tests/js_to_cpp_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/js/tests/interface_ptr_tests.js
diff --git a/mojo/edk/js/tests/interface_ptr_tests.js b/mojo/edk/js/tests/interface_ptr_tests.js
index d2bb1782330e6a08013e21cedb9e728adf08ddd6..22e0d6f15f3db3e3d1291050cbb8b9bb8adc028a 100644
--- a/mojo/edk/js/tests/interface_ptr_tests.js
+++ b/mojo/edk/js/tests/interface_ptr_tests.js
@@ -5,11 +5,13 @@
define([
"gin/test/expect",
"mojo/public/js/bindings",
+ "mojo/public/js/core",
"mojo/public/interfaces/bindings/tests/math_calculator.mojom",
"mojo/public/js/threading",
"gc",
], function(expect,
bindings,
+ core,
math,
threading,
gc) {
@@ -18,6 +20,7 @@ define([
.then(testReusable)
.then(testConnectionError)
.then(testPassInterface)
+ .then(testBindRawHandle)
.then(function() {
this.result = "PASS";
gc.collectGarbage(); // should not crash
@@ -138,4 +141,20 @@ define([
return promise;
}
+
+ function testBindRawHandle() {
+ var pipe = core.createMessagePipe();
+ var calc = new math.CalculatorPtr(pipe.handle0);
+ var newCalc = null;
+ var calcBinding = new bindings.Binding(math.Calculator,
+ new CalculatorImpl(),
+ pipe.handle1);
+
+ var promise = calc.add(2).then(function(response) {
+ expect(response.value).toBe(2);
+ return Promise.resolve();
+ });
+
+ return promise;
+ }
});
« no previous file with comments | « mojo/edk/js/tests/binding_tests.js ('k') | mojo/edk/js/tests/js_to_cpp_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698