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

Unified Diff: third_party/WebKit/LayoutTests/editing/execCommand/find-after-replace.html

Issue 2300553002: Convert editing/execCommand/find-after-replace.html to use w3c test harness (Closed)
Patch Set: 2016-08-31T15:00:58 Created 4 years, 4 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/platform/android/editing/execCommand/find-after-replace-expected.png » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/execCommand/find-after-replace.html
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/find-after-replace.html b/third_party/WebKit/LayoutTests/editing/execCommand/find-after-replace.html
index 461827c840d274d4c41f50b619331341779cac9d..07d62cdef3cf0011fbd4b879d89dcae6e3123543 100644
--- a/third_party/WebKit/LayoutTests/editing/execCommand/find-after-replace.html
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/find-after-replace.html
@@ -1,26 +1,19 @@
-<body onload="runTest()">
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
<script>
-if (window.testRunner)
- testRunner.dumpEditingCallbacks();
+ test(() => {
+ assert_not_equals(window.internals, undefined,
+ 'This test requires window.internals to access clipboard');
+ assert_selection(
+ '<div contenteditable>|a b a</div>',
+ selection => {
+ selection.document.execCommand('findString', false, 'a b');
+ selection.document.execCommand('copy');
+ selection.document.execCommand('findString', false, 'a');
+ selection.document.execCommand('paste');
+ },
+ '<div contenteditable>a b a b|</div>');
+ }, 'simulate find and replace');
</script>
-<p>This tests find and replace inside an editable iframe. You should see 'A B A B' below. With bug 4462420, you would see 'A B B A'.</p>
-<iframe src="../resources/contenteditable-iframe-src.html"></iframe>
-
-<script>
-function runTest() {
- document.body.offsetTop;
-
- var frame = frames[0];
- var sel = frame.getSelection();
- var doc = frame.document;
-
- sel.collapse(doc.body, 0);
- doc.execCommand("InsertText", false, "A B A");
- sel.collapse(doc.body, 0);
- doc.execCommand("FindString", false, "A B");
- doc.execCommand("Copy");
- doc.execCommand("FindString", false, "A");
- doc.execCommand("Paste");
-}
-</script>
-</body>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/platform/android/editing/execCommand/find-after-replace-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698