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

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

Issue 782693004: Update mojo sdk to rev f6c8ec07c01deebc13178d516225fd12695c3dc2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hack mojo_system_impl gypi for android :| Created 6 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
Index: mojo/edk/js/tests/connection_tests.js
diff --git a/mojo/edk/js/tests/connection_tests.js b/mojo/edk/js/tests/connection_tests.js
index 6649dfe7e159545c791612638f8ce5fdc84d8095..17009d9a1abaddcfffb636c3609cb3e8aa22a195 100644
--- a/mojo/edk/js/tests/connection_tests.js
+++ b/mojo/edk/js/tests/connection_tests.js
@@ -81,14 +81,20 @@ define([
threading.quit();
}.bind(this));
+ function createPeerConnection(handle, stubClass, proxyClass) {
+ var c = new connection.Connection(handle, stubClass, proxyClass);
+ c.local.peer = c.remote;
+ c.remote.peer = c.local;
+ return c;
+ }
+
function testClientServer() {
var receivedFrobinate = false;
var receivedDidFrobinate = false;
// ServiceImpl ------------------------------------------------------------
- function ServiceImpl(peer) {
- this.peer = peer;
+ function ServiceImpl() {
}
ServiceImpl.prototype = Object.create(
@@ -106,8 +112,7 @@ define([
// ServiceClientImpl ------------------------------------------------------
- function ServiceClientImpl(peer) {
- this.peer = peer;
+ function ServiceClientImpl() {
}
ServiceClientImpl.prototype =
@@ -123,10 +128,10 @@ define([
var anotherPipe = core.createMessagePipe();
var sourcePipe = core.createMessagePipe();
- var connection0 = new connection.Connection(
+ var connection0 = createPeerConnection(
pipe.handle0, ServiceImpl, sample_service.ServiceClient.proxyClass);
- var connection1 = new connection.Connection(
+ var connection1 = createPeerConnection(
pipe.handle1, ServiceClientImpl, sample_service.Service.proxyClass);
var foo = new sample_service.Foo();
@@ -163,7 +168,7 @@ define([
function testWriteToClosedPipe() {
var pipe = core.createMessagePipe();
- var connection1 = new connection.Connection(
+ var connection1 = createPeerConnection(
pipe.handle1, function() {}, sample_service.Service.proxyClass);
// Close the other end of the pipe.
@@ -192,8 +197,7 @@ define([
// ProviderImpl ------------------------------------------------------------
- function ProviderImpl(peer) {
- this.peer = peer;
+ function ProviderImpl() {
}
ProviderImpl.prototype =
@@ -211,8 +215,7 @@ define([
// ProviderClientImpl ------------------------------------------------------
- function ProviderClientImpl(peer) {
- this.peer = peer;
+ function ProviderClientImpl() {
}
ProviderClientImpl.prototype =
@@ -220,12 +223,12 @@ define([
var pipe = core.createMessagePipe();
- var connection0 = new connection.Connection(
+ var connection0 = createPeerConnection(
pipe.handle0,
ProviderImpl,
sample_interfaces.ProviderClient.proxyClass);
- var connection1 = new connection.Connection(
+ var connection1 = createPeerConnection(
pipe.handle1,
ProviderClientImpl,
sample_interfaces.Provider.proxyClass);

Powered by Google App Engine
This is Rietveld 408576698