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

Unified Diff: third_party/WebKit/LayoutTests/fast/text/script-tests/find-backwards.js

Issue 2905013004: Speed up LayoutTests/fast/text/find-backwards.html (Closed)
Patch Set: Created 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/text/find-backwards-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/text/script-tests/find-backwards.js
diff --git a/third_party/WebKit/LayoutTests/fast/text/script-tests/find-backwards.js b/third_party/WebKit/LayoutTests/fast/text/script-tests/find-backwards.js
deleted file mode 100644
index b271c99afaef0f251f07b9e471d8880a2b8951e6..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/text/script-tests/find-backwards.js
+++ /dev/null
@@ -1,68 +0,0 @@
-description("Tests find going both forward and backwards in small and large documents.");
-
-var selection = getSelection();
-
-function testFind(subjectString, pattern, backwards)
-{
- var textNode = document.createTextNode(subjectString);
- document.body.appendChild(textNode);
- selection.removeAllRanges();
- if (backwards) {
- var afterTextNodeRange = document.createRange();
- afterTextNodeRange.setStartAfter(textNode);
- afterTextNodeRange.setEndAfter(textNode);
- selection.addRange(afterTextNodeRange);
- } else {
- var beforeTextNodeRange = document.createRange();
- beforeTextNodeRange.setStartBefore(textNode);
- beforeTextNodeRange.setEndBefore(textNode);
- selection.addRange(beforeTextNodeRange);
- }
- var result;
- if (!find(pattern, false, backwards))
- result = "not found"
- else if (selection.rangeCount != 1)
- result = "internal inconsistency";
- else {
- var resultRange = selection.getRangeAt(0);
- if (resultRange.startContainer !== textNode || resultRange.endContainer !== textNode)
- result = "not found";
- else
- result = resultRange.startOffset + ", " + resultRange.endOffset;
- }
- document.body.removeChild(textNode);
- return result;
-}
-
-var forward = false;
-var backward = true;
-
-var manyCharacters = "1234567890"
-for (i = 0; i < 10; ++i)
- manyCharacters += manyCharacters;
-var tenThousandCharacters = manyCharacters.substring(0, 10000);
-
-shouldBe("testFind('abc', 'a', forward)", "'0, 1'");
-shouldBe("testFind('abc', 'b', forward)", "'1, 2'");
-shouldBe("testFind('abc', 'c', forward)", "'2, 3'");
-shouldBe("testFind('abc', 'a', backward)", "'0, 1'");
-shouldBe("testFind('abc', 'b', backward)", "'1, 2'");
-shouldBe("testFind('abc', 'c', backward)", "'2, 3'");
-shouldBe("testFind(tenThousandCharacters + 'abc' + tenThousandCharacters, 'a', forward)", "'10000, 10001'");
-shouldBe("testFind(tenThousandCharacters + 'abc' + tenThousandCharacters, 'b', forward)", "'10001, 10002'");
-shouldBe("testFind(tenThousandCharacters + 'abc' + tenThousandCharacters, 'c', forward)", "'10002, 10003'");
-shouldBe("testFind(tenThousandCharacters + 'abc' + tenThousandCharacters, 'a', backward)", "'10000, 10001'");
-shouldBe("testFind(tenThousandCharacters + 'abc' + tenThousandCharacters, 'b', backward)", "'10001, 10002'");
-shouldBe("testFind(tenThousandCharacters + 'abc' + tenThousandCharacters, 'c', backward)", "'10002, 10003'");
-shouldBe("testFind('abcabc', 'a', forward)", "'0, 1'");
-shouldBe("testFind('abcabc', 'b', forward)", "'1, 2'");
-shouldBe("testFind('abcabc', 'c', forward)", "'2, 3'");
-shouldBe("testFind('abcabc', 'a', backward)", "'3, 4'");
-shouldBe("testFind('abcabc', 'b', backward)", "'4, 5'");
-shouldBe("testFind('abcabc', 'c', backward)", "'5, 6'");
-shouldBe("testFind(tenThousandCharacters + 'abcabc' + tenThousandCharacters, 'a', forward)", "'10000, 10001'");
-shouldBe("testFind(tenThousandCharacters + 'abcabc' + tenThousandCharacters, 'b', forward)", "'10001, 10002'");
-shouldBe("testFind(tenThousandCharacters + 'abcabc' + tenThousandCharacters, 'c', forward)", "'10002, 10003'");
-shouldBe("testFind(tenThousandCharacters + 'abcabc' + tenThousandCharacters, 'a', backward)", "'10003, 10004'");
-shouldBe("testFind(tenThousandCharacters + 'abcabc' + tenThousandCharacters, 'b', backward)", "'10004, 10005'");
-shouldBe("testFind(tenThousandCharacters + 'abcabc' + tenThousandCharacters, 'c', backward)", "'10005, 10006'");
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/text/find-backwards-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698