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

Unified Diff: remoting/webapp/crd/js/host_controller_unittest.js

Issue 1161813006: Updated handling of GCD devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oops--ignore Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/crd/js/host_controller.js ('k') | remoting/webapp/crd/js/host_list_api.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/host_controller_unittest.js
diff --git a/remoting/webapp/crd/js/host_controller_unittest.js b/remoting/webapp/crd/js/host_controller_unittest.js
index 9b4aa77eca32a168c64266ddd5a4d31dab08900d..d5c010e59d55dd638a1296478e1b4186e43aa284 100644
--- a/remoting/webapp/crd/js/host_controller_unittest.js
+++ b/remoting/webapp/crd/js/host_controller_unittest.js
@@ -82,6 +82,7 @@ QUnit.module('host_controller', {
mockHostListApi = new remoting.MockHostListApi;
mockHostListApi.authCodeFromRegister = FAKE_AUTH_CODE;
mockHostListApi.emailFromRegister = '';
+ mockHostListApi.hostIdFromRegister = FAKE_HOST_ID;
remoting.HostListApi.setInstance(mockHostListApi);
base.debug.assert(remoting.oauth2 === null);
remoting.oauth2 = new remoting.OAuth2();
@@ -265,7 +266,7 @@ QUnit.test('start with host registration failure', function(assert) {
QUnit.test('start with getCredentialsFromAuthCode failure', function(assert) {
mockHostDaemonFacade.useEmail = null;
mockHostDaemonFacade.refreshToken = null;
- return controller.start(FAKE_HOST_PIN, true).then(function() {
+ return controller.start(FAKE_HOST_PIN, true).then(function(result) {
throw 'test failed';
}, function(/** remoting.Error */ e) {
assert.equal(e.getDetail(), 'getCredentialsFromAuthCode');
@@ -355,18 +356,23 @@ QUnit.test('start with startDaemon returning failure code', function(assert) {
assert.equal(unregisterHostByIdSpy.callCount, 0);
assert.equal(onLocalHostStartedSpy.callCount, 1);
assert.equal(startDaemonSpy.callCount, 1);
+ var expectedConfig = {
+ xmpp_login: FAKE_XMPP_LOGIN,
+ oauth_refresh_token: FAKE_REFRESH_TOKEN,
+ host_owner: FAKE_CLIENT_JID.toLowerCase(),
+ host_owner_email: FAKE_USER_EMAIL,
+ host_name: FAKE_HOST_NAME,
+ host_secret_hash: fakePinHash,
+ private_key: FAKE_PRIVATE_KEY
+ };
+ if (remoting.settings.USE_GCD) {
+ expectedConfig['gcd_device_id'] = FAKE_HOST_ID;
+ } else {
+ expectedConfig['host_id'] = FAKE_HOST_ID;
+ }
assert.deepEqual(
startDaemonSpy.args[0].slice(0, 2),
- [{
- xmpp_login: FAKE_XMPP_LOGIN,
- oauth_refresh_token: FAKE_REFRESH_TOKEN,
- host_owner: FAKE_CLIENT_JID.toLowerCase(),
- host_owner_email: FAKE_USER_EMAIL,
- host_id: FAKE_HOST_ID,
- host_name: FAKE_HOST_NAME,
- host_secret_hash: fakePinHash,
- private_key: FAKE_PRIVATE_KEY
- }, consent]);
+ [expectedConfig, consent]);
});
});
});
« no previous file with comments | « remoting/webapp/crd/js/host_controller.js ('k') | remoting/webapp/crd/js/host_list_api.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698