| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 QUnit.module('host_controller', { | 80 QUnit.module('host_controller', { |
| 81 beforeEach: function(/** QUnit.Assert */ assert) { | 81 beforeEach: function(/** QUnit.Assert */ assert) { |
| 82 chromeMocks.identity.mock$setToken(FAKE_IDENTITY_TOKEN); | 82 chromeMocks.identity.mock$setToken(FAKE_IDENTITY_TOKEN); |
| 83 remoting.settings = new remoting.Settings(); | 83 remoting.settings = new remoting.Settings(); |
| 84 remoting.identity = new remoting.Identity(); | 84 remoting.identity = new remoting.Identity(); |
| 85 mockHostListApi = new remoting.MockHostListApi; | 85 mockHostListApi = new remoting.MockHostListApi; |
| 86 mockHostListApi.authCodeFromRegister = FAKE_AUTH_CODE; | 86 mockHostListApi.authCodeFromRegister = FAKE_AUTH_CODE; |
| 87 mockHostListApi.emailFromRegister = ''; | 87 mockHostListApi.emailFromRegister = ''; |
| 88 mockHostListApi.hostIdFromRegister = FAKE_HOST_ID; | 88 mockHostListApi.hostIdFromRegister = FAKE_HOST_ID; |
| 89 mockHostListApi.hostIdFromConfig = FAKE_HOST_ID; |
| 89 remoting.HostListApi.setInstance(mockHostListApi); | 90 remoting.HostListApi.setInstance(mockHostListApi); |
| 90 base.debug.assert(remoting.oauth2 === null); | 91 base.debug.assert(remoting.oauth2 === null); |
| 91 remoting.oauth2 = new remoting.OAuth2(); | 92 remoting.oauth2 = new remoting.OAuth2(); |
| 92 base.debug.assert(remoting.hostList === null); | 93 base.debug.assert(remoting.hostList === null); |
| 93 remoting.hostList = /** @type {remoting.HostList} */ | 94 remoting.hostList = /** @type {remoting.HostList} */ |
| 94 (Object.create(remoting.HostList.prototype)); | 95 (Object.create(remoting.HostList.prototype)); |
| 95 | 96 |
| 96 // When the HostList's unregisterHostById method is called, make | 97 // When the HostList's unregisterHostById method is called, make |
| 97 // sure the argument is correct. | 98 // sure the argument is correct. |
| 98 unregisterHostByIdSpy = | 99 unregisterHostByIdSpy = |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 resolve(null); | 608 resolve(null); |
| 608 }); | 609 }); |
| 609 }); | 610 }); |
| 610 }); | 611 }); |
| 611 | 612 |
| 612 // Tests omitted for hasFeature, getPairedClients, deletePairedClient, | 613 // Tests omitted for hasFeature, getPairedClients, deletePairedClient, |
| 613 // and clearPairedClients because they simply call through to | 614 // and clearPairedClients because they simply call through to |
| 614 // HostDaemonFacade. | 615 // HostDaemonFacade. |
| 615 | 616 |
| 616 })(); | 617 })(); |
| OLD | NEW |