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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/selection/addRange.js

Issue 2719813004: selection: Update addRange-nn.html for 20170227 draft. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/selection/addRange-00-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/external/wpt/selection/addRange.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/selection/addRange.js b/third_party/WebKit/LayoutTests/external/wpt/selection/addRange.js
index 855520e538964cade61ee190e5b9a71de84f95cf..7c443f7dade9c236f146d09f274eb9113a5ff90d 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/selection/addRange.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/selection/addRange.js
@@ -2,19 +2,7 @@
function testAddRange(exception, range, endpoints, qualifier, testName) {
if (!isSelectableNode(endpoints[0]) || !isSelectableNode(endpoints[2])) {
- test(function() {
- assert_equals(exception, null, "Test setup must not throw exceptions");
-
- assertSelectionNoChange(function() { selection.addRange(range); });
- assert_equals(range.startContainer, endpoints[0],
- "addRange() must not modify the startContainer of the Range it's given");
- assert_equals(range.startOffset, endpoints[1],
- "addRange() must not modify the startOffset of the Range it's given");
- assert_equals(range.endContainer, endpoints[2],
- "addRange() must not modify the endContainer of the Range it's given");
- assert_equals(range.endOffset, endpoints[3],
- "addRange() must not modify the endOffset of the Range it's given");
- }, testName + ": " + qualifier + " addRange() must do nothing");
+ testAddRangeDoesNothing(exception, range, endpoints, qualifier, testName);
return;
}
@@ -127,6 +115,22 @@ function testAddRange(exception, range, endpoints, qualifier, testName) {
}, testName + ": modifying the Selection's last Range must modify the " + qualifier + " added Range");
}
+function testAddRangeDoesNothing(exception, range, endpoints, qualifier, testName) {
+ test(function() {
+ assert_equals(exception, null, "Test setup must not throw exceptions");
+
+ assertSelectionNoChange(function() { selection.addRange(range); });
+ assert_equals(range.startContainer, endpoints[0],
+ "addRange() must not modify the startContainer of the Range it's given");
+ assert_equals(range.startOffset, endpoints[1],
+ "addRange() must not modify the startOffset of the Range it's given");
+ assert_equals(range.endContainer, endpoints[2],
+ "addRange() must not modify the endContainer of the Range it's given");
+ assert_equals(range.endOffset, endpoints[3],
+ "addRange() must not modify the endOffset of the Range it's given");
+ }, testName + ": " + qualifier + " addRange() must do nothing");
+}
+
// Do only n evals, not n^2
var testRangesEvaled = testRanges.map(eval);
@@ -194,7 +198,7 @@ function testAddRangeSubSet(startIndex, optionalEndIndex) {
testAddRange(exception, range1, endpoints1, "first", testName);
if (selection.rangeCount > 0)
- testAddRange(exception, range2, endpoints2, "second", testName);
+ testAddRangeDoesNothing(exception, range2, endpoints2, "second", testName);
}
}
}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/selection/addRange-00-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698