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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/selection/common.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 | « third_party/WebKit/LayoutTests/external/wpt/selection/addRange-36-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 51579e42444e3c723ed9c80283887d163bfd150d..3bdc509462bd3713fbdb5110c8739b911151f4e8 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/selection/common.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/selection/common.js
@@ -964,13 +964,25 @@ function setSelectionBackwards(endpoints) {
* This function should be used in testharness tests.
*/
function assertSelectionNoChange(func) {
- var originalCount = getSelection().rangeCount;
+ var originalCount = selection.rangeCount;
var originalRange = originalCount == 0 ? null : selection.getRangeAt(0);
+ var originalAnchorNode = selection.anchorNode;
+ var originalAnchorOffset = selection.anchorOffset;
+ var originalFocusNode = selection.focusNode;
+ var originalFocusOffset = selection.focusOffset;
func();
assert_equals(selection.rangeCount, originalCount,
"The operation should not add Range");
+ assert_equals(selection.anchorNode, originalAnchorNode,
+ "The operation should not update anchorNode");
+ assert_equals(selection.anchorOffset, originalAnchorOffset,
+ "The operation should not update anchorOffset");
+ assert_equals(selection.focusNode, originalFocusNode,
+ "The operation should not update focusNode");
+ assert_equals(selection.focusOffset, originalFocusOffset,
+ "The operation should not update focusOffset");
if (originalCount < 1)
return;
assert_equals(selection.getRangeAt(0), originalRange,
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/selection/addRange-36-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698