| Index: third_party/WebKit/LayoutTests/external/wpt/selection/common.js
|
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/selection/common.js b/third_party/WebKit/LayoutTests/external/wpt/selection/common.js
|
| index 85375d5723adceb037e7ce977a34c286fd96f7a4..4b37c2632c2cc19d8b47eb0486cf78e2fb641cd9 100644
|
| --- a/third_party/WebKit/LayoutTests/external/wpt/selection/common.js
|
| +++ b/third_party/WebKit/LayoutTests/external/wpt/selection/common.js
|
| @@ -958,3 +958,22 @@ function setSelectionBackwards(endpoints) {
|
| selection.extend(endpoints[0], endpoints[1]);
|
| }
|
| }
|
| +
|
| +/**
|
| + * Verify that the specified func doesn't change the selection.
|
| + * This function should be used in testharness tests.
|
| + */
|
| +function assertSelectionNoChange(func) {
|
| + var originalCount = getSelection().rangeCount;
|
| + var originalRange = originalCount == 0 ? null : selection.getRangeAt(0);
|
| +
|
| + func();
|
| +
|
| + assert_equals(selection.rangeCount, originalCount,
|
| + "The operation should not add Range");
|
| + if (originalCount < 1)
|
| + return;
|
| + assert_equals(selection.getRangeAt(0), originalRange,
|
| + "The operation should not replace a registered Range");
|
| +}
|
| +
|
|
|