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

Unified Diff: chrome/browser/resources/chromeos/chromevox/common/content_editable_extractor_test.unitjs

Issue 548523002: Add a forgotten ChromeVox test to the build system. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renameunit
Patch Set: rebase 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
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/common/content_editable_extractor_test.unitjs
diff --git a/chrome/browser/resources/chromeos/chromevox/common/content_editable_extractor_test.unitjs b/chrome/browser/resources/chromeos/chromevox/common/content_editable_extractor_test.unitjs
index 92351626a4ca1403c6343c3afb3f12c359fd7665..c5f0fa3ba5757b3a5c53b6e5c95a33f0c6829434 100644
--- a/chrome/browser/resources/chromeos/chromevox/common/content_editable_extractor_test.unitjs
+++ b/chrome/browser/resources/chromeos/chromevox/common/content_editable_extractor_test.unitjs
@@ -21,6 +21,22 @@ CvoxContentEditableExtractorUnitTest.prototype = {
]
};
+/**
+ * Helper function to set the selection
+ * @param {Node} startNode The base/start node of the range.
+ * @param {number} startOffset The 0-based character index of the start.
+ * @param {Node} endNode The extent/end node of the range.
+ * @param {number} endOffset The 0-based character index of the end.
+ */
+function setSelection(startNode, startOffset, endNode, endOffset) {
+ var r = document.createRange();
+ r.setStart(startNode, startOffset);
+ r.setEnd(endNode, endOffset);
+ var sel = window.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(r);
+}
+
TEST_F('CvoxContentEditableExtractorUnitTest', 'EmptyElement', function() {
this.loadDoc(function() {/*!
<div>
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698