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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html

Issue 2321863002: Convert fast/dom/Range/deleteData-replaceData-count-overflow.html to use w3c test harness (Closed)
Patch Set: 2016-09-08T11:01:54 Created 4 years, 3 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/Range/deleteData-replaceData-count-overflow-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html b/third_party/WebKit/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html
index c96b30db52c08c6357cf86d6a5121438c9dc25a6..d85941bca2d7e6b7a7f8a357ae97618e3bfdf225 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html
@@ -1,37 +1,40 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<script src="../../../resources/js-test.js"></script>
-</head>
-<body>
+<!doctype html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
<script>
-description("Test deleteData() + replaceData() overflow handling.");
+test(() => {
+ const textNode = new Text('chopped off and then some');
+ const range = new Range();
+ range.setStart(textNode, textNode.length);
+ textNode.deleteData(11, 0xfffffff7);
+ assert_equals(textNode.data, 'chopped off');
+ assert_equals(range.endOffset, 11);
+}, 'Range#deleteData() with huge end offset');
-var textNode;
-var range;
+test(() => {
+ const textNode = new Text('hello world');
+ const range = new Range();
+ range.setStart(textNode, textNode.length);
+ textNode.replaceData(6, 0xfffffffe, 'bob');
+ assert_equals(textNode.data, 'hello bob');
+ assert_equals(range.endOffset, 6);
+}, 'Range#replaceData() with huge end offset');
-shouldBeNonNull("textNode = new Text('chopped off and then some'); textNode");
-document.body.appendChild(textNode);
-document.getSelection().extend(textNode, textNode.length);
-range = document.getSelection().getRangeAt(0);
+test(() => {
+ const textNode = new Text('hello world');
+ const range = new Range();
+ range.setStart(textNode, textNode.length);
+ textNode.replaceData(6, -1, 'bob');
+ assert_equals(textNode.data, 'hello bob');
+ assert_equals(range.endOffset, 6);
+}, 'Range#replaceData() with negative end offset(-1)');
-shouldBeEqualToString("textNode.deleteData(11, 0xfffffff7); textNode.data", "chopped off");
-shouldBe("range.endOffset", "11");
-document.body.removeChild(textNode);
-
-shouldBeNonNull("textNode = new Text('hello world'); textNode");
-document.body.appendChild(textNode);
-document.getSelection().extend(textNode, textNode.length);
-range = document.getSelection().getRangeAt(0);
-
-shouldBeEqualToString("textNode.replaceData(6, 0xfffffffe, 'bob'); textNode.data", "hello bob");
-shouldBe("range.endOffset", "6");
-document.body.removeChild(textNode);
-
-shouldBeNonNull("textNode = new Text('hello world'); textNode");
-shouldBeEqualToString("textNode.replaceData(6, -1, 'bob'); textNode.data", "hello bob");
-shouldBeNonNull("textNode = new Text('hello world'); textNode");
-shouldBeEqualToString("textNode.replaceData(6, -2, 'bob'); textNode.data", "hello bob");
+test(() => {
+ const textNode = new Text('hello world');
+ const range = new Range();
+ range.setStart(textNode, textNode.length);
+ textNode.replaceData(6, -2, 'bob');
+ assert_equals(textNode.data, 'hello bob');
+ assert_equals(range.endOffset, 6);
+}, 'Range#replaceData() with negative end offset(-2)');
</script>
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698