summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js
diff options
context:
space:
mode:
authordtseng <dtseng@chromium.org>2014-09-29 12:36:32 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-29 19:36:46 +0000
commit930fcbcccbb7a4c0c8892acf175503555099e29c (patch)
tree62353b1d9bb51fa46c19fad7d85bb716f22cad35 /chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js
parentaf111ac4b1deff9861bef0dd6a76004b0dae265e (diff)
downloadchromium_src-930fcbcccbb7a4c0c8892acf175503555099e29c.zip
chromium_src-930fcbcccbb7a4c0c8892acf175503555099e29c.tar.gz
chromium_src-930fcbcccbb7a4c0c8892acf175503555099e29c.tar.bz2
ImplementChromeVox next/previous line, link, and heading.
Review URL: https://codereview.chromium.org/586103004 Cr-Commit-Position: refs/heads/master@{#297234}
Diffstat (limited to 'chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js')
-rw-r--r--chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js35
1 files changed, 6 insertions, 29 deletions
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 1f5c96d..869a0c3 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.