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

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

Issue 586103004: Implement ChromeVox next/previous line, link, and heading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Added test (and support). Created 6 years, 3 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 bef9ee783bc42a227c191bbf878f0d56420e75a3..9cc689072e53b9e15d16611b8acf12d2b6aeea29 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
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+GEN_INCLUDE([
+ 'chrome/browser/resources/chromeos/chromevox/testing/common.js']);
+
/**
* Base test fixture for ChromeVox end to end tests.
*
@@ -52,6 +55,30 @@ ChromeVoxE2ETest.prototype = {
ash::A11Y_NOTIFICATION_NONE);
WaitForExtension(extension_misc::kChromeVoxExtensionId, load_cb);
*/});
+ },
+
+ /**
+ * Run a test with the specified HTML snippet loaded.
+ * @param {function() : void} doc Snippet wrapped inside of a function.
+ * @param {function()} callback Called once the document is ready.
+ */
+ runWithDocument: function(doc, callback) {
dmazzoni 2014/09/26 06:08:52 Nice!
+ var docString = TestUtils.extractHtmlFromCommentEncodedString(doc);
+ var url = 'data:text/html,<!doctype html><html><body>' +
+ docString +
+ '<!-- chromevox_next_test -->' +
+ '</body></html>';
+ var createParams = {
+ 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();
+ }
+ });
+ });
}
};

Powered by Google App Engine
This is Rietveld 408576698