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> |