Index: chrome/browser/resources/chromeos/chromevox/testing/chromevox_e2e_test_base.js |
diff --git a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_e2e_test_base.js b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_e2e_test_base.js |
index 9b797cbf58a0b0536b59864ca6e1c44e0c2585a9..16a0a5a32e9b4293c53eb52e435e85809e40effd 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_e2e_test_base.js |
+++ b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_e2e_test_base.js |
@@ -3,7 +3,8 @@ |
// found in the LICENSE file. |
GEN_INCLUDE([ |
- 'chrome/browser/resources/chromeos/chromevox/testing/common.js']); |
+ 'chrome/browser/resources/chromeos/chromevox/testing/common.js', |
+ 'chrome/browser/resources/chromeos/chromevox/testing/callback_helper.js']); |
/** |
* Base test fixture for ChromeVox end to end tests. |
@@ -12,7 +13,9 @@ GEN_INCLUDE([ |
* background page context. |
* @constructor |
*/ |
-function ChromeVoxE2ETest() {} |
+function ChromeVoxE2ETest() { |
+ this.callbackHelper_ = new CallbackHelper(this); |
+} |
ChromeVoxE2ETest.prototype = { |
__proto__: testing.Test.prototype, |
@@ -101,6 +104,18 @@ ChromeVoxE2ETest.prototype = { |
*/}, [key, elementQueryString]); |
chrome.tabs.executeScript(tabId, {code: code}); |
+ }, |
+ |
+ /** |
+ * Creates a callback that optionally calls {@code opt_callback} when |
+ * called. If this method is called one or more times, then |
+ * {@code testDone()} will be called when all callbacks have been called. |
+ * @param {Function=} opt_callback Wrapped callback that will have its this |
+ * reference bound to the test fixture. |
+ * @return {Function} |
+ */ |
+ newCallback: function(opt_callback) { |
+ return this.callbackHelper_.wrap(opt_callback); |
} |
}; |