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

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

Issue 2008773002: Begin using ChromeVox Next to read tab and window titles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a bunch of tests. Created 4 years, 7 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 14d7727f70f0e368bea90df668fdaa6938e27048..e82329eba19bd3bf028067d8bcbe817cb1e8f3ff 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
@@ -45,22 +45,29 @@ ChromeVoxNextE2ETest.prototype = {
* @param {function() : void} doc Snippet wrapped inside of a function.
* @param {function(chrome.automation.AutomationNode)} callback
* Called once the document is ready.
+ * @param {string=} opt_url Optional url to wait for. Defaults to undefined.
*/
- runWithLoadedTree: function(doc, callback) {
+ runWithLoadedTree: function(doc, callback, opt_url) {
callback = this.newCallback(callback);
chrome.automation.getDesktop(function(r) {
- this.runWithTab(doc, function(newTabUrl) {
- var listener = function(evt) {
- if (!evt.target.docUrl || evt.target.docUrl != newTabUrl)
- return;
+ var url = opt_url || TestUtils.createUrlForDoc(doc);
+ var listener = function(evt) {
+ if (evt.target.root.url != url)
+ return;
- r.removeEventListener('loadComplete', listener, true);
- global.backgroundObj.onGotCommand('nextObject');
- callback && callback(evt.target);
- callback = null;
- };
- r.addEventListener('loadComplete', listener, true);
- }.bind(this));
+ r.removeEventListener('focus', listener, true);
+ r.removeEventListener('loadComplete', listener, true);
+ global.backgroundObj.onGotCommand('nextObject');
+ callback && callback(evt.target);
+ callback = null;
+ };
+ r.addEventListener('focus', listener, true);
+ r.addEventListener('loadComplete', listener, true);
+ var createParams = {
+ active: true,
+ url: url
+ };
+ chrome.tabs.create(createParams);
}.bind(this));
},

Powered by Google App Engine
This is Rietveld 408576698