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

Unified Diff: chrome/browser/resources/chromeos/chromevox/testing/chromevox_e2e_test_base.js

Issue 938623003: Fix ChromeVox next tests to fail instead of timing out where applicable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify async callback handling in the tests. 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: 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);
}
};

Powered by Google App Engine
This is Rietveld 408576698