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

Unified Diff: mojo/public/js/tests/interface_ptr_unittest.js

Issue 2676443005: Add interface versioning. Methods queryVersion and requireVersion. (Closed)
Patch Set: Created 3 years, 10 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: mojo/public/js/tests/interface_ptr_unittest.js
diff --git a/mojo/public/js/tests/interface_ptr_unittest.js b/mojo/public/js/tests/interface_ptr_unittest.js
index 22e0d6f15f3db3e3d1291050cbb8b9bb8adc028a..950d2a38ea6ae10be76b17a4c439e348d7b04994 100644
--- a/mojo/public/js/tests/interface_ptr_unittest.js
+++ b/mojo/public/js/tests/interface_ptr_unittest.js
@@ -7,12 +7,14 @@ define([
"mojo/public/js/bindings",
"mojo/public/js/core",
"mojo/public/interfaces/bindings/tests/math_calculator.mojom",
+ "mojo/public/interfaces/bindings/tests/sample_interfaces.mojom",
"mojo/public/js/threading",
"gc",
], function(expect,
bindings,
core,
math,
+ sampleInterfaces,
threading,
gc) {
testIsBound()
@@ -21,6 +23,7 @@ define([
.then(testConnectionError)
.then(testPassInterface)
.then(testBindRawHandle)
+ .then(testQueryVersion)
.then(function() {
this.result = "PASS";
gc.collectGarbage(); // should not crash
@@ -157,4 +160,16 @@ define([
return promise;
}
+
+ function testQueryVersion() {
+ var integerAccessorImpl = new sampleInterfaces.IntegerAccessorPtr();
yzshen1 2017/02/06 06:57:26 This is not an "implementation". An implementation
yzshen1 2017/02/06 07:04:18 Sorry, I meant to say "You should use the Binding
+ var request = bindings.makeRequest(integerAccessorImpl);
yzshen1 2017/02/06 06:57:26 The problem is that you need to provide support fo
+ expect(integerAccessorImpl.ptr.version).toBe(0);
+
+ return integerAccessorImpl.ptr.queryVersion().then(function(version) {
+ expect(version).toBe(3);
+ expect(integerAccessorImpl.ptr.version).toBe(3);
+ });
+ }
});
+

Powered by Google App Engine
This is Rietveld 408576698