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

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

Issue 2698413002: selection: Align collapse-NN.html and extend-NN.html to the latest 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
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");
+}
+

Powered by Google App Engine
This is Rietveld 408576698