OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 /** |
| 6 * @fileoverview |
| 7 * @suppress {checkTypes|checkVars|reportUnknownTypes|visibility} |
| 8 */ |
| 9 |
5 (function() { | 10 (function() { |
6 | 11 |
7 'use strict'; | 12 'use strict'; |
8 | 13 |
9 var hostInstaller = null; | 14 var hostInstaller = null; |
10 var hangoutPort = null; | 15 var hangoutPort = null; |
11 var host = null; | 16 var host = null; |
12 var helpeeChannel = null; | 17 var helpeeChannel = null; |
13 var onDisposedCallback = null; | 18 var onDisposedCallback = null; |
14 | 19 |
15 module('It2MeHelpeeChannel', { | 20 module('It2MeHelpeeChannel', { |
16 setup: function() { | 21 setup: function() { |
17 // HangoutPort | 22 // HangoutPort |
18 hangoutPort = new chromeMocks.runtime.Port(); | 23 hangoutPort = new chrome.runtime.Port(); |
19 hangoutPort.postMessage = sinon.spy(hangoutPort, 'postMessage'); | 24 hangoutPort.postMessage = sinon.spy(hangoutPort, 'postMessage'); |
20 hangoutPort.disconnect = sinon.spy(hangoutPort, 'disconnect'); | 25 hangoutPort.disconnect = sinon.spy(hangoutPort, 'disconnect'); |
21 | 26 |
22 // onDisposedCallback callback | 27 // onDisposedCallback callback |
23 onDisposedCallback = sinon.spy(); | 28 onDisposedCallback = sinon.spy(); |
24 | 29 |
25 // Host | 30 // Host |
26 host = { | 31 host = { |
27 initialize: function() {}, | 32 initialize: function() {}, |
28 initialized: function() {}, | 33 initialized: function() {}, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 164 |
160 test('should disconnect the session if Hangout crashes', function() { | 165 test('should disconnect the session if Hangout crashes', function() { |
161 sinon.spy(host, 'disconnect'); | 166 sinon.spy(host, 'disconnect'); |
162 hangoutPort.onDisconnect.mock$fire(); | 167 hangoutPort.onDisconnect.mock$fire(); |
163 | 168 |
164 sinon.assert.called(onDisposedCallback); | 169 sinon.assert.called(onDisposedCallback); |
165 sinon.assert.called(host.disconnect); | 170 sinon.assert.called(host.disconnect); |
166 }); | 171 }); |
167 | 172 |
168 })(); | 173 })(); |
OLD | NEW |