| Index: chrome/browser/resources/google_now/common_test_util.js
|
| diff --git a/chrome/browser/resources/google_now/common_test_util.js b/chrome/browser/resources/google_now/common_test_util.js
|
| index 44d21e6d1f640ea07406a7919738959bcbb09706..864492a08ca9becdf2c0c3e4ee54fb5eafeb307f 100644
|
| --- a/chrome/browser/resources/google_now/common_test_util.js
|
| +++ b/chrome/browser/resources/google_now/common_test_util.js
|
| @@ -129,6 +129,28 @@ var Promise = function() {
|
| });
|
| return promise;
|
| }
|
| +
|
| + function resolve(value) {
|
| + var promise = new PromisePrototypeObject(function(resolve) {
|
| + resolve(value);
|
| + });
|
| + return promise;
|
| + }
|
| +
|
| PromisePrototypeObject.all = all;
|
| + PromisePrototypeObject.resolve = resolve;
|
| return PromisePrototypeObject;
|
| }();
|
| +
|
| +
|
| +/**
|
| + * Sets up the test to expect a Chrome Local Storage call.
|
| + * @param {Object} fixture Mock JS Test Object.
|
| + * @param {Object} defaultObject Storage request default object.
|
| + * @param {Object} result Storage result.
|
| + */
|
| +function expectChromeLocalStorageGet(fixture, defaultObject, result) {
|
| + fixture.mockApis.expects(once()).
|
| + fillFromChromeLocalStorage(eqJSON(defaultObject)).
|
| + will(returnValue(Promise.resolve(result)));
|
| +}
|
|
|