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

Side by Side Diff: mojo/apps/js/bindings/connector_unittests.js

Issue 189453003: Moves around mojo js bindings code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/apps/js/bindings/connector.js ('k') | mojo/apps/js/bindings/core.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Mock out the support module to avoid depending on the message loop. 5 // Mock out the support module to avoid depending on the message loop.
6 define("mojo/apps/js/bindings/support", function() { 6 define("mojo/bindings/js/support", function() {
7 var waitingCallbacks = []; 7 var waitingCallbacks = [];
8 8
9 function WaitCookie(id) { 9 function WaitCookie(id) {
10 this.id = id; 10 this.id = id;
11 } 11 }
12 12
13 function asyncWait(handle, flags, callback) { 13 function asyncWait(handle, flags, callback) {
14 var id = waitingCallbacks.length; 14 var id = waitingCallbacks.length;
15 waitingCallbacks.push(callback); 15 waitingCallbacks.push(callback);
16 return new WaitCookie(id); 16 return new WaitCookie(id);
(...skipping 22 matching lines...) Expand all
39 var exports = {}; 39 var exports = {};
40 exports.asyncWait = asyncWait; 40 exports.asyncWait = asyncWait;
41 exports.cancelWait = cancelWait; 41 exports.cancelWait = cancelWait;
42 exports.numberOfWaitingCallbacks = numberOfWaitingCallbacks; 42 exports.numberOfWaitingCallbacks = numberOfWaitingCallbacks;
43 exports.pumpOnce = pumpOnce; 43 exports.pumpOnce = pumpOnce;
44 return exports; 44 return exports;
45 }); 45 });
46 46
47 define([ 47 define([
48 "gin/test/expect", 48 "gin/test/expect",
49 "mojo/apps/js/bindings/support", 49 "mojo/bindings/js/support",
50 "mojo/apps/js/bindings/core", 50 "mojo/bindings/js/core",
51 "mojo/apps/js/bindings/connector", 51 "mojo/public/bindings/js/connector",
52 "mojo/public/bindings/tests/sample_service.mojom", 52 "mojo/public/bindings/tests/sample_service.mojom",
53 ], function(expect, mockSupport, core, connector, sample) { 53 ], function(expect, mockSupport, core, connector, sample) {
54 54
55 var receivedFrobinate = false; 55 var receivedFrobinate = false;
56 var receivedDidFrobinate = false; 56 var receivedDidFrobinate = false;
57 57
58 // ServiceImpl -------------------------------------------------------------- 58 // ServiceImpl --------------------------------------------------------------
59 59
60 function ServiceImpl(peer) { 60 function ServiceImpl(peer) {
61 this.peer = peer; 61 this.peer = peer;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 expect(core.close(anotherPipe.handle0)).toBe(core.RESULT_INVALID_ARGUMENT); 123 expect(core.close(anotherPipe.handle0)).toBe(core.RESULT_INVALID_ARGUMENT);
124 // anotherPipe.handle1 hasn't been closed yet. 124 // anotherPipe.handle1 hasn't been closed yet.
125 expect(core.close(anotherPipe.handle1)).toBe(core.RESULT_OK); 125 expect(core.close(anotherPipe.handle1)).toBe(core.RESULT_OK);
126 126
127 // The Connection object is responsible for closing these handles. 127 // The Connection object is responsible for closing these handles.
128 expect(core.close(pipe.handle0)).toBe(core.RESULT_INVALID_ARGUMENT); 128 expect(core.close(pipe.handle0)).toBe(core.RESULT_INVALID_ARGUMENT);
129 expect(core.close(pipe.handle1)).toBe(core.RESULT_INVALID_ARGUMENT); 129 expect(core.close(pipe.handle1)).toBe(core.RESULT_INVALID_ARGUMENT);
130 130
131 this.result = "PASS"; 131 this.result = "PASS";
132 }); 132 });
OLDNEW
« no previous file with comments | « mojo/apps/js/bindings/connector.js ('k') | mojo/apps/js/bindings/core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698