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

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

Issue 890013006: Reland #2: Ensure WebView notifies desktop automation on creation, destruction, and change Original (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more potential case. Created 5 years, 10 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_next_e2e_test_base.js
diff --git a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js
index e432a998de5f9d711f04ff24f136c4ef8509eeee..013c800098b011f7d12398b59617f2aade462d7b 100644
--- a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js
+++ b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js
@@ -29,11 +29,20 @@ ChromeVoxNextE2ETest.prototype = {
GEN('#include "base/command_line.h"');
},
- runWithAutomation: function(doc, callback) {
- this.runWithDocument(doc, function() {
- chrome.automation.getTree(function(root) {
- callback(root);
- }.bind(this));
+ /**
+ * Launches a new tab with the given document, and runs callback when a load
+ * complete fires.
+ * @param {function() : void} doc Snippet wrapped inside of a function.
+ * @param {function()} opt_callback Called once the document is ready.
+ */
+ runWithLoadedTree: function(doc, callback) {
+ chrome.automation.getDesktop(function(r) {
+ function callbackInternal(evt) {
+ r.removeEventListener(callbackInternal);
+ callback(evt.target);
+ }
+ r.addEventListener('loadComplete', callbackInternal, true);
+ this.runWithTab(doc);
}.bind(this));
}
};

Powered by Google App Engine
This is Rietveld 408576698