| 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);
|
| }
|
| }
|
| }
|
|
|