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

Unified Diff: chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_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: Address comments. 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_unittest_base.js
diff --git a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js
index 1f5c96d32b4d289aadbbeb8e42ab98c2ee1b546b..869a0c3f62ad58b35581a44bda4d643467b997f9 100644
--- a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js
+++ b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js
@@ -4,15 +4,8 @@
GEN_INCLUDE([
'chrome/browser/resources/chromeos/chromevox/testing/assert_additions.js']);
-
-/**
- * Shortcut for document.getElementById.
- * @param {string} id of the element.
- * @return {HTMLElement} with the id.
- */
-function $(id) {
- return document.getElementById(id);
-}
+GEN_INCLUDE([
+ 'chrome/browser/resources/chromeos/chromevox/testing/common.js']);
/**
* Base test fixture for ChromeVox unit tests.
@@ -74,7 +67,8 @@ ChromeVoxUnitTestBase.prototype = {
* comment inside an anonymous function - see example, above.
*/
loadDoc: function(commentEncodedHtml) {
- var html = this.extractHtmlFromCommentEncodedString_(commentEncodedHtml);
+ var html =
+ TestUtils.extractHtmlFromCommentEncodedString(commentEncodedHtml);
this.loadHtml(html);
},
@@ -91,7 +85,8 @@ ChromeVoxUnitTestBase.prototype = {
* comment inside an anonymous function - see example, above.
*/
appendDoc: function(commentEncodedHtml) {
- var html = this.extractHtmlFromCommentEncodedString_(commentEncodedHtml);
+ var html =
+ TestUtils.extractHtmlFromCommentEncodedString(commentEncodedHtml);
this.appendHtml(html);
},
@@ -111,24 +106,6 @@ ChromeVoxUnitTestBase.prototype = {
},
/**
- * Extracts some inlined html encoded as a comment inside a function,
- * so you can use it like this:
- *
- * this.appendDoc(function() {/*!
- * <p>Html goes here</p>
- * * /});
- *
- * @param {Function} commentEncodedHtml The html , embedded as a
- * comment inside an anonymous function - see example, above.
- @ @return {String} The html text.
- */
- extractHtmlFromCommentEncodedString_: function(commentEncodedHtml) {
- return commentEncodedHtml.toString().
- replace(/^[^\/]+\/\*!?/, '').
- replace(/\*\/[^\/]+$/, '');
- },
-
- /**
* Waits for the queued events in ChromeVoxEventWatcher to be
* handled, then calls a callback function with provided arguments
* in the test case scope. Very useful for asserting the results of events.

Powered by Google App Engine
This is Rietveld 408576698