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

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/paste_into_element_starting_with_invisible.html

Issue 2450943005: Convert editing/spelling/paste_into_element_starting_with_invisible.html with spellcheck_test (Closed)
Patch Set: Remove garbage Created 4 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/spelling/paste_into_element_starting_with_invisible.html
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/paste_into_element_starting_with_invisible.html b/third_party/WebKit/LayoutTests/editing/spelling/paste_into_element_starting_with_invisible.html
index 1fa57b228974248323426c9b03668e76efaedfa8..15a1a2ca24c588f33aa3343cf2c252c1a75849c3 100644
--- a/third_party/WebKit/LayoutTests/editing/spelling/paste_into_element_starting_with_invisible.html
+++ b/third_party/WebKit/LayoutTests/editing/spelling/paste_into_element_starting_with_invisible.html
@@ -1,31 +1,27 @@
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
-<script src="resources/util.js"></script>
-
-<div id="source">
-zz.
-</div>
-
-<div contenteditable>
-<span id="target">[]</span>
-</div>
+<script src="../assert_selection.js"></script>
+<script src="spellcheck_test.js"></script>
<script>
// Regression test for crbug.com/640456
-function copyAndPaste() {
- var source = document.getElementById('source');
- var target = document.getElementById('target');
- var sel = window.getSelection();
- sel.selectAllChildren(source);
- document.execCommand('copy');
- sel.collapse(target.firstChild, 1);
- document.execCommand('paste');
-}
-
-runSpellingTest(
- [() => copyAndPaste()],
- [() => assert_true(internals.hasSpellingMarker(document, 1, 2))],
- 'Spelling markers should appear immediately after pasting.');
+spellcheck_test(
+ [
+ '<div contenteditable>\n',
+ '<span id="target">[|]</span>\n',
+ '</div>'
+ ].join(''),
+ document => {
+ document.getSelection().setClipboardData('zz.');
+ document.execCommand('paste');
+ },
+ [
+ '<div contenteditable>\n',
+ '<span id="target">[_zz_.]</span>\n',
+ '</div>'
+ ].join(''),
+ 'Spelling markers should appear immediately after pasting.'
+);
</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698