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

Unified Diff: remoting/webapp/js_proto/chrome_mocks.js

Issue 1015043002: Add optional scopes parameter to Identity.getToken(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/js_proto/chrome_mocks.js
diff --git a/remoting/webapp/js_proto/chrome_mocks.js b/remoting/webapp/js_proto/chrome_mocks.js
index 3b404b64ccf506d8c84eff075b835712fd9775f9..e64421db527c5d8ef483d5f633452e66fb928613 100644
--- a/remoting/webapp/js_proto/chrome_mocks.js
+++ b/remoting/webapp/js_proto/chrome_mocks.js
@@ -192,8 +192,13 @@ chromeMocks.Identity = function() {
* @param {function(string=):void} callback
*/
chromeMocks.Identity.prototype.getAuthToken = function(options, callback) {
+ // Append the 'scopes' array, if present, to the dummy token.
+ var token = this.token_;
+ if (token !== undefined && options['scopes'] !== undefined) {
+ token += JSON.stringify(options['scopes']);
+ }
// Don't use setTimeout because sinon mocks it.
- window.requestAnimationFrame(callback.bind(null, this.token_));
+ window.requestAnimationFrame(callback.bind(null, token));
};
/** @param {string} token */

Powered by Google App Engine
This is Rietveld 408576698