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..754e2578fa2f6bf059a5b2b70fbb7ea8c6ed0bed 100644 |
--- a/chrome/browser/resources/google_now/common_test_util.js |
+++ b/chrome/browser/resources/google_now/common_test_util.js |
@@ -82,35 +82,16 @@ |
var Promise = function() { |
function PromisePrototypeObject(asyncTask) { |
var result; |
- var resolved = false; |
asyncTask( |
function(asyncResult) { |
result = asyncResult; |
- resolved = true; |
}, |
- function(asyncFailureResult) { |
- result = asyncFailureResult; |
- resolved = false; |
- }); |
+ function() {}); // Errors are unsupported. |
function then(callback) { |
- if (resolved) { |
- callback.call(null, result); |
- } |
- return this; |
+ callback.call(null, result); |
} |
- |
- // Promises use the function name "catch" to call back error handlers. |
- // We can't use "catch" since function or variable names cannot use the word |
- // "catch". |
- function catchFunc(callback) { |
- if (!resolved) { |
- callback.call(null, result); |
- } |
- return this; |
- } |
- |
- return {then: then, catch: catchFunc, isPromise: true}; |
+ return {then: then, isPromise: true}; |
} |
function all(arrayOfPromises) { |