| 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 a1e449090dc9215314166dffe10c3374125380aa..3b404b64ccf506d8c84eff075b835712fd9775f9 100644
|
| --- a/remoting/webapp/js_proto/chrome_mocks.js
|
| +++ b/remoting/webapp/js_proto/chrome_mocks.js
|
| @@ -104,7 +104,11 @@ chromeMocks.runtime.sendMessage = function(extensionId, message,
|
| chromeMocks.runtime.id = 'extensionId';
|
|
|
| /** @type {Object} */
|
| -chromeMocks.storage = {};
|
| +chromeMocks.runtime.lastError = {
|
| + /** @type {string|undefined} */
|
| + message: undefined
|
| +};
|
| +
|
|
|
| // Sample implementation of chrome.StorageArea according to
|
| // https://developer.chrome.com/apps/storage#type-StorageArea
|
| @@ -170,9 +174,41 @@ chromeMocks.StorageArea.prototype.clear = function() {
|
| this.storage_ = null;
|
| };
|
|
|
| +/** @type {Object} */
|
| +chromeMocks.storage = {};
|
| +
|
| /** @type {chromeMocks.StorageArea} */
|
| chromeMocks.storage.local = new chromeMocks.StorageArea();
|
|
|
| +
|
| +/** @constructor */
|
| +chromeMocks.Identity = function() {
|
| + /** @private {string|undefined} */
|
| + this.token_ = undefined;
|
| +};
|
| +
|
| +/**
|
| + * @param {Object} options
|
| + * @param {function(string=):void} callback
|
| + */
|
| +chromeMocks.Identity.prototype.getAuthToken = function(options, callback) {
|
| + // Don't use setTimeout because sinon mocks it.
|
| + window.requestAnimationFrame(callback.bind(null, this.token_));
|
| +};
|
| +
|
| +/** @param {string} token */
|
| +chromeMocks.Identity.prototype.mock$setToken = function(token) {
|
| + this.token_ = token;
|
| +};
|
| +
|
| +chromeMocks.Identity.prototype.mock$clearToken = function() {
|
| + this.token_ = undefined;
|
| +};
|
| +
|
| +/** @type {chromeMocks.Identity} */
|
| +chromeMocks.identity = new chromeMocks.Identity();
|
| +
|
| +
|
| var originals_ = null;
|
|
|
| /**
|
|
|