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

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/ranges/Range-collapse.html

Issue 1988983002: Move the dom directory from web-platform-tests/ to wpt/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/imported/web-platform-tests/dom/ranges/Range-collapse.html
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/ranges/Range-collapse.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/ranges/Range-collapse.html
deleted file mode 100644
index 6678fb292da2df553184e48bb8558687c66e0a38..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/ranges/Range-collapse.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!doctype html>
-<title>Range.collapse() and .collapsed tests</title>
-<link rel="author" title="Aryeh Gregor" href=ayg@aryeh.name>
-<meta name=timeout content=long>
-<div id=log></div>
-<script src=../../../../resources/testharness.js></script>
-<script src=../../../../resources/testharnessreport.js></script>
-<script src=../common.js></script>
-<script>
-"use strict";
-
-function testCollapse(rangeEndpoints, toStart) {
- var range;
- if (rangeEndpoints == "detached") {
- range = document.createRange();
- range.detach(); // should be a no-op and therefore the following should not throw
- range.collapse(toStart);
- assert_equals(true, range.collapsed);
- }
-
- // Have to account for Ranges involving Documents!
- var ownerDoc = rangeEndpoints[0].nodeType == Node.DOCUMENT_NODE
- ? rangeEndpoints[0]
- : rangeEndpoints[0].ownerDocument;
- range = ownerDoc.createRange();
- range.setStart(rangeEndpoints[0], rangeEndpoints[1]);
- range.setEnd(rangeEndpoints[2], rangeEndpoints[3]);
-
- var expectedContainer = toStart ? range.startContainer : range.endContainer;
- var expectedOffset = toStart ? range.startOffset : range.endOffset;
-
- assert_equals(range.collapsed, range.startContainer == range.endContainer
- && range.startOffset == range.endOffset,
- "collapsed must be true if and only if the start and end are equal");
-
- if (toStart === undefined) {
- range.collapse();
- } else {
- range.collapse(toStart);
- }
-
- assert_equals(range.startContainer, expectedContainer,
- "Wrong startContainer");
- assert_equals(range.endContainer, expectedContainer,
- "Wrong endContainer");
- assert_equals(range.startOffset, expectedOffset,
- "Wrong startOffset");
- assert_equals(range.endOffset, expectedOffset,
- "Wrong endOffset");
- assert_true(range.collapsed,
- ".collapsed must be set after .collapsed()");
-}
-
-var tests = [];
-for (var i = 0; i < testRanges.length; i++) {
- tests.push([
- "Range " + i + " " + testRanges[i] + ", toStart true",
- eval(testRanges[i]),
- true
- ]);
- tests.push([
- "Range " + i + " " + testRanges[i] + ", toStart false",
- eval(testRanges[i]),
- false
- ]);
- tests.push([
- "Range " + i + " " + testRanges[i] + ", toStart omitted",
- eval(testRanges[i]),
- undefined
- ]);
-}
-generate_tests(testCollapse, tests);
-
-testDiv.style.display = "none";
-</script>

Powered by Google App Engine
This is Rietveld 408576698