OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * Unit tests for host_controller.js. | 7 * Unit tests for host_controller.js. |
8 */ | 8 */ |
9 | 9 |
10 (function() { | 10 (function() { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 /** @type {sinon.Spy} */ | 68 /** @type {sinon.Spy} */ |
69 var unregisterHostByIdSpy; | 69 var unregisterHostByIdSpy; |
70 | 70 |
71 /** @type {sinon.Spy} */ | 71 /** @type {sinon.Spy} */ |
72 var onLocalHostStartedSpy; | 72 var onLocalHostStartedSpy; |
73 | 73 |
74 QUnit.module('host_controller', { | 74 QUnit.module('host_controller', { |
75 beforeEach: function(/** QUnit.Assert */ assert) { | 75 beforeEach: function(/** QUnit.Assert */ assert) { |
76 chromeMocks.activate(['identity', 'runtime']); | 76 chromeMocks.activate(['identity', 'runtime']); |
77 chromeMocks.identity.mock$setToken(FAKE_IDENTITY_TOKEN); | 77 chromeMocks.identity.mock$setToken(FAKE_IDENTITY_TOKEN); |
| 78 remoting.settings = new remoting.Settings(); |
78 remoting.identity = new remoting.Identity(); | 79 remoting.identity = new remoting.Identity(); |
79 remoting.MockXhr.activate(); | 80 remoting.MockXhr.activate(); |
80 base.debug.assert(remoting.oauth2 === null); | 81 base.debug.assert(remoting.oauth2 === null); |
81 remoting.oauth2 = new remoting.OAuth2(); | 82 remoting.oauth2 = new remoting.OAuth2(); |
82 base.debug.assert(remoting.hostList === null); | 83 base.debug.assert(remoting.hostList === null); |
83 remoting.hostList = /** @type {remoting.HostList} */ | 84 remoting.hostList = /** @type {remoting.HostList} */ |
84 (Object.create(remoting.HostList.prototype)); | 85 (Object.create(remoting.HostList.prototype)); |
85 | 86 |
86 // When the HostList's unregisterHostById method is called, make | 87 // When the HostList's unregisterHostById method is called, make |
87 // sure the argument is correct. | 88 // sure the argument is correct. |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 resolve(null); | 668 resolve(null); |
668 }); | 669 }); |
669 }); | 670 }); |
670 }); | 671 }); |
671 | 672 |
672 // Tests omitted for hasFeature, getPairedClients, deletePairedClient, | 673 // Tests omitted for hasFeature, getPairedClients, deletePairedClient, |
673 // and clearPairedClients because they simply call through to | 674 // and clearPairedClients because they simply call through to |
674 // HostDaemonFacade. | 675 // HostDaemonFacade. |
675 | 676 |
676 })(); | 677 })(); |
OLD | NEW |