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

Unified Diff: third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy-test.html

Issue 2320023003: [WIP] compare test cases (Closed)
Patch Set: compare test cases 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 | 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/pasteboard/restore-collapsed-space-for-copy-test.html
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy-test.html b/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy-test.html
new file mode 100644
index 0000000000000000000000000000000000000000..a46a589f7c3d603f2a625f045d6a039f378b615f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy-test.html
@@ -0,0 +1,27 @@
+<!doctype HTML>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script>
+test(() => assert_selection(
+ '<div style="width: 2em;"><b><i>foo</i></b> bar</div><div contenteditable>|</div>',
+ selection => {
+ selection.setClipboardData('<b><i>foo</i></b> bar');
+ selection.document.execCommand('paste');
+ },
+ '<div style="width: 2em;"><b><i>foo</i></b> bar</div><div contenteditable><b><i>foo</i></b> bar|</div>'),
+ '1. Restore the collapsed leading space');
+
+test(() => assert_selection(
+ '<div style="width: 2em;">^<b><i>foo</i></b> bar|</div><div contenteditable id="editor"></div>',
+ selection => {
+ var copy = selection.document.getElementById('copy');
+ var editor = selection.document.getElementById('editor');
+
+ selection.document.execCommand('copy');
+ selection.collapse(editor);
+ selection.document.execCommand('paste');
+ },
+ '<div style="width: 2em;"><b><i>foo</i></b> bar</div><div contenteditable id="editor"><b><i>foo</i></b>\u00A0bar|</div>'),
+ '2. Restore the collapsed leading space');
+</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