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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/dom/ranges/StaticRange-mutable.html

Issue 2791373002: [InputEvent] Make StaticRange immutable and move tests to wpt (Closed)
Patch Set: Created 3 years, 9 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/dom/ranges/StaticRange-mutable.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/ranges/StaticRange-mutable.html b/third_party/WebKit/LayoutTests/external/wpt/dom/ranges/StaticRange-mutable.html
new file mode 100644
index 0000000000000000000000000000000000000000..91912095c5a381a7bfdfb8081cdb1db10bdeff13
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/dom/ranges/StaticRange-mutable.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<title>StaticRange: Property mutable and .setStart/.setEnd</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id='txt'>
+abcdefg
+</div>
+<script>
+test(() => {
+ const txt = document.getElementById('txt');
+ const staticRange = new StaticRange();
+ staticRange.startContainer = txt;
+ staticRange.startOffset = 0;
+ staticRange.endContainer = txt;
+ staticRange.endOffset = 1;
+ assert_equals(staticRange.startContainer, txt);
+ assert_equals(staticRange.startOffset, 0);
+ assert_equals(staticRange.endContainer, txt);
+ assert_equals(staticRange.endOffset, 1);
+ assert_false(staticRange.collapsed);
+}, 'Property mutable');
foolip 2017/04/04 04:32:36 Suggest 'Mutable attributes' or 'Attributes are mu
chongz 2017/04/07 18:14:11 Changed to test "Attributes are immutable".
+
+test(() => {
+ const txt = document.getElementById('txt');
+ const staticRange = new StaticRange();
+ staticRange.setStart(txt, 0);
+ staticRange.setEnd(txt, 1);
+ assert_equals(staticRange.startContainer, txt);
+ assert_equals(staticRange.startOffset, 0);
+ assert_equals(staticRange.endContainer, txt);
+ assert_equals(staticRange.endOffset, 1);
+ assert_false(staticRange.collapsed);
+}, 'setStart, setEnd');
foolip 2017/04/04 04:32:36 Can you split this into two separate tests, and as
chongz 2017/04/07 18:14:11 Removed |setStart/End()|.
+</script>

Powered by Google App Engine
This is Rietveld 408576698