Chromium Code Reviews

Unified Diff: third_party/WebKit/LayoutTests/editing/assert_selection.html

Issue 2303533003: Introduce selection.setClipboardData() in assert_selection() (Closed)
Patch Set: 2016-09-01T18:36:42 Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/assert_selection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/assert_selection.html
diff --git a/third_party/WebKit/LayoutTests/editing/assert_selection.html b/third_party/WebKit/LayoutTests/editing/assert_selection.html
index 8b0c933ef0792bc11d14cb0a0f7c98f7fcfb7ae8..5a0796cd397dc08426cd282276339c03f2287517 100644
--- a/third_party/WebKit/LayoutTests/editing/assert_selection.html
+++ b/third_party/WebKit/LayoutTests/editing/assert_selection.html
@@ -133,4 +133,33 @@ test(() => {
'insertHTML <span style="color: green">green</span>',
'<div contenteditable><p><span style="color: green">green|</span></p></div>');
}, 'multiple spaces in function');
+
+test(() => {
+ assert_selection(
+ '<div contenteditable>|</div>',
+ selection => {
+ selection.setClipboardData('<b>foo</b>');
+ selection.document.execCommand('paste');
+ },
+ '<div contenteditable><b>foo|</b></div>',
+ 'set HTML fragment to clipboard and paste');
+
+ assert_selection(
+ '<div contenteditable>|</div>',
+ selection => {
+ selection.setClipboardData('<b>foo</b>');
+ selection.document.execCommand('pasteAndMatchStyle');
+ },
+ '<div contenteditable>foo|</div>',
+ 'set HTML fragment to clipboard and pasteAndMatchStyle');
+
+ assert_selection(
+ '<div contenteditable>|</div>',
+ selection => {
+ selection.setClipboardData('<b>foo</b>', 'FOO');
+ selection.document.execCommand('pasteAndMatchStyle');
+ },
+ '<div contenteditable>FOO|</div>',
+ 'set HTML fragment and text to clipboard and pasteAndMatchStyle');
+}, 'selection.setClipboardData');
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/assert_selection.js » ('j') | no next file with comments »

Powered by Google App Engine