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

Unified Diff: mojo/apps/js/bindings/connection_unittests.js

Issue 628763002: Mojo JS bindings: simplify mojo.connectToService() usage - Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed template indentation Created 6 years, 2 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/test/data/data_sender_unittest.js ('k') | mojo/apps/js/bindings/sample_service_unittests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/apps/js/bindings/connection_unittests.js
diff --git a/mojo/apps/js/bindings/connection_unittests.js b/mojo/apps/js/bindings/connection_unittests.js
index 0b0a71b2d03a217173fc251b0f5ee776b22be037..258192d34bae753e20c673325f8e98e13b7bdb61 100644
--- a/mojo/apps/js/bindings/connection_unittests.js
+++ b/mojo/apps/js/bindings/connection_unittests.js
@@ -85,13 +85,14 @@ define([
var receivedFrobinate = false;
var receivedDidFrobinate = false;
- // ServiceImpl -------------------------------------------------------------
+ // ServiceImpl ------------------------------------------------------------
function ServiceImpl(peer) {
this.peer = peer;
}
- ServiceImpl.prototype = Object.create(sample_service.ServiceStub.prototype);
+ ServiceImpl.prototype = Object.create(
+ sample_service.Service.stubClass.prototype);
ServiceImpl.prototype.frobinate = function(foo, baz, port) {
receivedFrobinate = true;
@@ -103,14 +104,14 @@ define([
this.peer.didFrobinate(42);
};
- // ServiceImpl -------------------------------------------------------------
+ // ServiceClientImpl ------------------------------------------------------
function ServiceClientImpl(peer) {
this.peer = peer;
}
ServiceClientImpl.prototype =
- Object.create(sample_service.ServiceClientStub.prototype);
+ Object.create(sample_service.ServiceClient.stubClass.prototype);
ServiceClientImpl.prototype.didFrobinate = function(result) {
receivedDidFrobinate = true;
@@ -123,10 +124,10 @@ define([
var sourcePipe = core.createMessagePipe();
var connection0 = new connection.Connection(
- pipe.handle0, ServiceImpl, sample_service.ServiceClientProxy);
+ pipe.handle0, ServiceImpl, sample_service.ServiceClient.proxyClass);
var connection1 = new connection.Connection(
- pipe.handle1, ServiceClientImpl, sample_service.ServiceProxy);
+ pipe.handle1, ServiceClientImpl, sample_service.Service.proxyClass);
var foo = new sample_service.Foo();
foo.bar = new sample_service.Bar();
@@ -163,7 +164,7 @@ define([
var pipe = core.createMessagePipe();
var connection1 = new connection.Connection(
- pipe.handle1, function() {}, sample_service.ServiceProxy);
+ pipe.handle1, function() {}, sample_service.Service.proxyClass);
// Close the other end of the pipe.
core.close(pipe.handle0);
@@ -196,7 +197,7 @@ define([
}
ProviderImpl.prototype =
- Object.create(sample_interfaces.ProviderStub.prototype);
+ Object.create(sample_interfaces.Provider.stubClass.prototype);
ProviderImpl.prototype.echoString = function(a) {
mockSupport.queuePump(core.RESULT_OK);
@@ -215,15 +216,19 @@ define([
}
ProviderClientImpl.prototype =
- Object.create(sample_interfaces.ProviderClientStub.prototype);
+ Object.create(sample_interfaces.ProviderClient.stubClass.prototype);
var pipe = core.createMessagePipe();
var connection0 = new connection.Connection(
- pipe.handle0, ProviderImpl, sample_interfaces.ProviderClientProxy);
+ pipe.handle0,
+ ProviderImpl,
+ sample_interfaces.ProviderClient.proxyClass);
var connection1 = new connection.Connection(
- pipe.handle1, ProviderClientImpl, sample_interfaces.ProviderProxy);
+ pipe.handle1,
+ ProviderClientImpl,
+ sample_interfaces.Provider.proxyClass);
var origReadMessage = core.readMessage;
// echoString
« no previous file with comments | « extensions/test/data/data_sender_unittest.js ('k') | mojo/apps/js/bindings/sample_service_unittests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698