Index: third_party/WebKit/LayoutTests/editing/spelling/mixed_paste.html |
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/mixed_paste.html b/third_party/WebKit/LayoutTests/editing/spelling/mixed_paste.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2ef4ee5646f5ea7f158504e3d283bfd28f1ebf53 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/editing/spelling/mixed_paste.html |
@@ -0,0 +1,29 @@ |
+<!doctype html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script src="../assert_selection.js"></script> |
+<script src="spellcheck_test.js"></script> |
+<script> |
+spellcheck_test( |
+ '<div contenteditable>|</div>', |
+ document => { |
+ document.getSelection().setClipboardData( |
+ '<img src="../resources/abe.png"> zz zz.'); |
+ document.execCommand('paste'); |
+ }, |
+ '<div contenteditable><img src="../resources/abe.png"> _zz_ _zz_.</div>', |
+ 'Mark misspelled words after pasting mixed content of image and text.'); |
+ |
+// Create HTML longer than the spellchecker's chunk size 16384. |
+const longHTML = `<img src="../resources/abe.png"> zz${' ah'.repeat(5461)}`; |
+const expectedHTML = `<img src="../resources/abe.png"> _zz_${' ah'.repeat(5461)}`; |
+spellcheck_test( |
+ '<div contenteditable>|</div>', |
+ document => { |
+ document.getSelection().setClipboardData(longHTML); |
+ document.execCommand('paste'); |
+ }, |
+ '<div contenteditable>' + expectedHTML + '</div>', |
+ 'Mark misspelled word after pasting mixed content of image and long text.'); |
+</script> |
+ |