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

Unified Diff: chrome/browser/resources/chromeos/chromevox/testing/chromevox_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_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 1edf3167bd8121ddaa27520ce6ed1162fa3bfde1..a14c753d84413f589b1384d2449d467414bd123f 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
@@ -58,11 +58,26 @@ ChromeVoxE2ETest.prototype = {
},
/**
- * Run a test with the specified HTML snippet loaded.
+ * Launch a new tab, wait until tab status complete, then run callback.
* @param {function() : void} doc Snippet wrapped inside of a function.
* @param {function()} callback Called once the document is ready.
*/
- runWithDocument: function(doc, callback) {
+ runWithLoadedTab: function(doc, callback) {
+ this.launchNewTabWithDoc(doc, function(tab) {
+ chrome.tabs.onUpdated.addListener(function(tabId, changeInfo) {
+ if (tabId == tab.id && changeInfo.status == 'complete') {
+ callback(tabId);
+ }
+ });
+ });
+ },
+
+ /**
+ * Launches the given document in a new tab.
+ * @param {function() : void} doc Snippet wrapped inside of a function.
+ * @param {function()} opt_callback Called once the document is created.
+ */
+ runWithTab: function(doc, opt_callback) {
var docString = TestUtils.extractHtmlFromCommentEncodedString(doc);
var url = 'data:text/html,<!doctype html>' +
docString +
@@ -71,13 +86,7 @@ ChromeVoxE2ETest.prototype = {
active: true,
url: url
};
- chrome.tabs.create(createParams, function(tab) {
- chrome.tabs.onUpdated.addListener(function(tabId, changeInfo) {
- if (tabId == tab.id && changeInfo.status == 'complete') {
- callback(tabId);
- }
- });
- });
+ chrome.tabs.create(createParams, opt_callback);
},
/**

Powered by Google App Engine
This is Rietveld 408576698