| 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * @suppress {checkTypes|checkVars|reportUnknownTypes|visibility} | 7 * @suppress {checkTypes|checkVars|reportUnknownTypes|visibility} |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 (function() { | 10 (function() { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 method: remoting.It2MeHelpeeChannel.HangoutMessageTypes.DOWNLOAD_HOST | 119 method: remoting.It2MeHelpeeChannel.HangoutMessageTypes.DOWNLOAD_HOST |
| 120 }); | 120 }); |
| 121 | 121 |
| 122 sinon.assert.called(hostInstaller.download); | 122 sinon.assert.called(hostInstaller.download); |
| 123 }); | 123 }); |
| 124 | 124 |
| 125 QUnit.asyncTest('connect() should return access code', | 125 QUnit.asyncTest('connect() should return access code', |
| 126 function() { | 126 function() { |
| 127 // Stubs authentication. | 127 // Stubs authentication. |
| 128 sinon.stub(base, 'isAppsV2').returns(true); | 128 sinon.stub(base, 'isAppsV2').returns(true); |
| 129 sinon.stub(remoting.HangoutConsentDialog, 'getInstance').returns({ | |
| 130 show : function() { | |
| 131 return Promise.resolve(); | |
| 132 } | |
| 133 }); | |
| 134 sinon.stub(chrome.identity, 'getAuthToken') | 129 sinon.stub(chrome.identity, 'getAuthToken') |
| 135 .callsArgWith(1, 'token'); | 130 .callsArgWith(1, 'token'); |
| 136 sinon.stub(remoting.identity, 'getToken') | 131 sinon.stub(remoting.identity, 'getToken') |
| 137 .returns(Promise.resolve('token')); | 132 .returns(Promise.resolve('token')); |
| 138 sinon.stub(remoting.identity, 'getEmail') | 133 sinon.stub(remoting.identity, 'getEmail') |
| 139 .returns(Promise.resolve('test@chromium.org')); | 134 .returns(Promise.resolve('test@chromium.org')); |
| 140 // Stubs Host behavior. | 135 // Stubs Host behavior. |
| 141 sinon.stub(host, 'initialized').returns(true); | 136 sinon.stub(host, 'initialized').returns(true); |
| 142 sinon.stub(host, 'connect') | 137 sinon.stub(host, 'connect') |
| 143 .callsArgWith(2, remoting.HostSession.State.RECEIVED_ACCESS_CODE); | 138 .callsArgWith(2, remoting.HostSession.State.RECEIVED_ACCESS_CODE); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 164 | 159 |
| 165 test('should disconnect the session if Hangout crashes', function() { | 160 test('should disconnect the session if Hangout crashes', function() { |
| 166 sinon.spy(host, 'disconnect'); | 161 sinon.spy(host, 'disconnect'); |
| 167 hangoutPort.onDisconnect.mock$fire(); | 162 hangoutPort.onDisconnect.mock$fire(); |
| 168 | 163 |
| 169 sinon.assert.called(onDisposedCallback); | 164 sinon.assert.called(onDisposedCallback); |
| 170 sinon.assert.called(host.disconnect); | 165 sinon.assert.called(host.disconnect); |
| 171 }); | 166 }); |
| 172 | 167 |
| 173 })(); | 168 })(); |
| OLD | NEW |