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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/StaticRange/staticrange-constructor.html

Issue 2022863002: [InputEvent] Introduce |StaticRange| and use in |InputEvent::getRanges()| (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 | « no previous file | third_party/WebKit/LayoutTests/fast/dom/StaticRange/staticrange-no-mutate.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/StaticRange/staticrange-constructor.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StaticRange/staticrange-constructor.html b/third_party/WebKit/LayoutTests/fast/dom/StaticRange/staticrange-constructor.html
new file mode 100644
index 0000000000000000000000000000000000000000..d94294a1663747dd800b166f8fd920e09d0ae05e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/StaticRange/staticrange-constructor.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>StaticRange: constructor</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+</head>
+<body>
+abcdefg
+<script>
+test(function() {
+ // Basic interface.
+ assert_equals(typeof new StaticRange, 'object');
+ assert_equals(Object.prototype.toString.call(new StaticRange), '[object StaticRange]');
+ assert_true(new StaticRange instanceof StaticRange);
+ assert_equals(Object.getPrototypeOf(new StaticRange), StaticRange.prototype);
+
+ // Initialize new StaticRange.
+ var txt = document.body.firstChild;
+ var staticRange = new StaticRange();
+ staticRange.setStart(txt, 0);
+ staticRange.setEnd(txt, 5);
+ assert_equals(staticRange.startContainer, txt);
+ assert_equals(staticRange.startOffset, 0);
+ assert_equals(staticRange.endContainer, txt);
+ assert_equals(staticRange.endOffset, 5);
+ assert_false(staticRange.collapsed);
+
+ // Property mutable.
+ staticRange.startContainer = document.body;
+ staticRange.startOffset = 0;
+ staticRange.endContainer = document.body;
+ staticRange.endOffset = 0;
+ assert_equals(staticRange.startContainer, document.body);
+ assert_equals(staticRange.startOffset, 0);
+ assert_equals(staticRange.endContainer, document.body);
+ assert_equals(staticRange.endOffset, 0);
+ assert_true(staticRange.collapsed);
+}, 'Testing StaticRange constructor');
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/StaticRange/staticrange-no-mutate.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698