| 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 5b94f86da739f311ce2d65ed59fd6830c0ce3576..855520e538964cade61ee190e5b9a71de84f95cf 100644
|
| --- a/third_party/WebKit/LayoutTests/external/wpt/selection/addRange.js
|
| +++ b/third_party/WebKit/LayoutTests/external/wpt/selection/addRange.js
|
| @@ -1,6 +1,23 @@
|
| "use strict";
|
|
|
| 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");
|
| + return;
|
| + }
|
| +
|
| test(function() {
|
| assert_equals(exception, null, "Test setup must not throw exceptions");
|
|
|
| @@ -176,7 +193,8 @@ function testAddRangeSubSet(startIndex, optionalEndIndex) {
|
| }
|
|
|
| testAddRange(exception, range1, endpoints1, "first", testName);
|
| - testAddRange(exception, range2, endpoints2, "second", testName);
|
| + if (selection.rangeCount > 0)
|
| + testAddRange(exception, range2, endpoints2, "second", testName);
|
| }
|
| }
|
| }
|
|
|