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

Unified Diff: remoting/webapp/browser_test/mock_oauth2_api.js

Issue 984203003: Move mocks and unittest JS files to sit alongside production code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 9 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
Index: remoting/webapp/browser_test/mock_oauth2_api.js
diff --git a/remoting/webapp/browser_test/mock_oauth2_api.js b/remoting/webapp/browser_test/mock_oauth2_api.js
deleted file mode 100644
index 412ddaa182684b60b8c994114910be4496f0d64f..0000000000000000000000000000000000000000
--- a/remoting/webapp/browser_test/mock_oauth2_api.js
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2014 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
- * Mock implementation of remoting.OAuth2Api
- */
-
-'use strict';
-
-/** @suppress {duplicate} */
-var remoting = remoting || {};
-
-/**
- * @constructor
- * @implements {remoting.OAuth2Api}
- */
-remoting.MockOAuth2Api = function() {
- /**
- * @type {string}
- * @private
- */
- this.email_ = 'fake-email@test-user.com';
-
- /**
- * @type {string}
- * @private
- */
- this.fullName_ = 'Fake User, Esq.';
-};
-
-/**
- * @param {function(string, number): void} onDone
- * @param {function(!remoting.Error):void} onError
- * @param {string} clientId
- * @param {string} clientSecret
- * @param {string} refreshToken
- * @return {void} Nothing.
- */
-remoting.MockOAuth2Api.prototype.refreshAccessToken = function(
- onDone, onError, clientId, clientSecret, refreshToken) {
- window.setTimeout(
- onDone.bind(null, remoting.MockIdentity.AccessToken.VALID, 60 * 60),
- 0);
-};
-
-/**
- * @param {function(string, string, number): void} onDone
- * @param {function(!remoting.Error):void} onError
- * @param {string} clientId
- * @param {string} clientSecret
- * @param {string} code
- * @param {string} redirectUri
- * @return {void} Nothing.
- */
-remoting.MockOAuth2Api.prototype.exchangeCodeForTokens = function(
- onDone, onError, clientId, clientSecret, code, redirectUri) {
- window.setTimeout(
- onDone.bind(null, '', remoting.MockIdentity.AccessToken.VALID, 60 * 60),
- 0);
-};
-
-/**
- * @param {function(string,string)} onDone
- * @param {function(!remoting.Error)} onError
- * @param {string} token
- */
-remoting.MockOAuth2Api.prototype.getEmail = function(onDone, onError, token) {
- remoting.MockIdentity.validateTokenAndCall(
- token, onDone, onError, [this.email_]);
-};
-
-/**
- * @param {function(string,string)} onDone
- * @param {function(!remoting.Error)} onError
- * @param {string} token
- */
-remoting.MockOAuth2Api.prototype.getUserInfo =
- function(onDone, onError, token) {
- remoting.MockIdentity.validateTokenAndCall(
- token, onDone, onError, [this.email_, this.fullName_]);
-};
-
-
-/**
- * @param {boolean} active
- */
-remoting.MockOAuth2Api.setActive = function(active) {
- remoting.oauth2Api = active ? new remoting.MockOAuth2Api()
- : new remoting.OAuth2ApiImpl();
-};
« no previous file with comments | « remoting/webapp/browser_test/mock_identity.js ('k') | remoting/webapp/browser_test/mock_session_connector.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698