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

Unified Diff: remoting/webapp/crd/js/host_list_api_impl_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_list_api_impl.js ('k') | remoting/webapp/crd/js/legacy_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_list_api_impl_unittest.js
diff --git a/remoting/webapp/crd/js/host_list_api_impl_unittest.js b/remoting/webapp/crd/js/host_list_api_impl_unittest.js
deleted file mode 100644
index 4e7bc3d861ca63d9892272306399eb32f14221b9..0000000000000000000000000000000000000000
--- a/remoting/webapp/crd/js/host_list_api_impl_unittest.js
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview
- * Unit tests for host_controller.js.
- */
-
-(function() {
-
-'use strict';
-
-var FAKE_HOST_ID = '0bad0bad-0bad-0bad-0bad-0bad0bad0bad';
-var FAKE_HOST_NAME = '<FAKE_HOST_NAME>';
-var FAKE_PUBLIC_KEY = '<FAKE_PUBLIC_KEY>';
-var FAKE_HOST_CLIENT_ID = '<FAKE_HOST_CLIENT_ID>';
-var FAKE_AUTH_CODE = '<FAKE_AUTH_CODE>';
-
-QUnit.module('host_list_api_impl', {
- beforeEach: function(/** QUnit.Assert */ assert) {
- remoting.settings = new remoting.Settings();
- remoting.MockXhr.activate();
- },
- afterEach: function(/** QUnit.Assert */ assert) {
- remoting.MockXhr.restore();
- remoting.settings = null;
- }
-});
-
-/**
- * Install an HTTP response for requests to the registry.
- * @param {QUnit.Assert} assert
- */
-function queueRegistryResponse(assert) {
- var responseJson = {
- data: {
- authorizationCode: FAKE_AUTH_CODE
- }
- };
-
- remoting.MockXhr.setResponseFor(
- 'POST', 'DIRECTORY_API_BASE_URL/@me/hosts',
- function(/** remoting.MockXhr */ xhr) {
- assert.deepEqual(
- xhr.params.jsonContent,
- { data: {
- hostId: FAKE_HOST_ID,
- hostName: FAKE_HOST_NAME,
- publicKey: FAKE_PUBLIC_KEY
- } });
- xhr.setJsonResponse(200, responseJson);
- });
-}
-
-QUnit.test('register', function(assert) {
- var impl = new remoting.HostListApiImpl();
- queueRegistryResponse(assert);
- return impl.register(
- FAKE_HOST_ID,
- FAKE_HOST_NAME,
- FAKE_PUBLIC_KEY,
- FAKE_HOST_CLIENT_ID
- ). then(function(regResult) {
- assert.equal(regResult.authCode, FAKE_AUTH_CODE);
- assert.equal(regResult.email, '');
- });
-});
-
-QUnit.test('register failure', function(assert) {
- var impl = new remoting.HostListApiImpl();
- remoting.MockXhr.setEmptyResponseFor(
- 'POST', 'DIRECTORY_API_BASE_URL/@me/hosts', 500);
- return impl.register(
- FAKE_HOST_ID,
- FAKE_HOST_NAME,
- FAKE_PUBLIC_KEY,
- FAKE_HOST_CLIENT_ID
- ).then(function(authCode) {
- throw 'test failed';
- }, function(/** remoting.Error */ e) {
- assert.equal(e.getTag(), remoting.Error.Tag.REGISTRATION_FAILED);
- });
-});
-
-})();
« no previous file with comments | « remoting/webapp/crd/js/host_list_api_impl.js ('k') | remoting/webapp/crd/js/legacy_host_list_api.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698