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

Side by Side Diff: remoting/webapp/unittests/chrome_mocks.js

Issue 468693002: Hangouts remote desktop part III - It2MeService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix UT failure Created 6 years, 4 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 | « remoting/webapp/remoting.js ('k') | remoting/webapp/unittests/it2me_helper_channel_unittest.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This file contains various mock objects for the chrome platform to make
6 // unit testing easier.
7
8 (function(scope){
9
10 var chromeMocks = {};
11
12 chromeMocks.Event = function() {
13 this.listeners_ = [];
14 };
15
16 chromeMocks.Event.prototype.addListener = function(callback) {
17 this.listeners_.push(callback);
18 };
19
20 chromeMocks.Event.prototype.removeListener = function(callback) {
21 for (var i = 0; i < this.listeners_.length; i++) {
22 if (this.listeners_[i] === callback) {
23 this.listeners_.splice(i, 1);
24 break;
25 }
26 }
27 };
28
29 chromeMocks.Event.prototype.mock$fire = function(data) {
30 this.listeners_.forEach(function(listener){
31 listener(data);
32 });
33 };
34
35 chromeMocks.runtime = {};
36
37 chromeMocks.runtime.Port = function() {
38 this.onMessage = new chromeMocks.Event();
39 this.onDisconnect = new chromeMocks.Event();
40
41 this.name = '';
42 this.sender = null;
43 };
44
45 chromeMocks.runtime.Port.prototype.disconnect = function() {};
46 chromeMocks.runtime.Port.prototype.postMessage = function() {};
47
48 scope.chromeMocks = chromeMocks;
49
50 })(window);
OLDNEW
« no previous file with comments | « remoting/webapp/remoting.js ('k') | remoting/webapp/unittests/it2me_helper_channel_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698