| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../assert_selection.js"></script> | 4 <script src="../assert_selection.js"></script> |
| 5 <script> | 5 <script> |
| 6 test(() => { | 6 test(() => { |
| 7 assert_not_equals(window.internals, undefined, | 7 assert_not_equals(window.internals, undefined, |
| 8 'This test requires window.internals to access clipboard'); | 8 'This test requires window.internals to access clipboard'); |
| 9 | 9 |
| 10 // TDOO(yosin): We should consolidate "paste-text-00[6-9].html" since | |
| 11 // they were commited in one patch. | |
| 12 | |
| 13 assert_selection( | 10 assert_selection( |
| 14 '<div contenteditable>foo ^bar| baz</div>', | 11 '<div contenteditable>foo ^bar| baz</div>', |
| 15 selection => { | 12 selection => { |
| 16 selection.document.execCommand('copy'); | 13 selection.document.execCommand('copy'); |
| 17 selection.collapseToEnd(); | 14 selection.collapseToEnd(); |
| 18 selection.document.execCommand('paste'); | 15 selection.document.execCommand('paste'); |
| 19 }, | 16 }, |
| 20 '<div contenteditable>foo barbar|\u{00A0}baz</div>', | 17 '<div contenteditable>foo barbar|\u{00A0}baz</div>', |
| 21 '1 Paste text after text'); | 18 '1 Paste text after text'); |
| 22 | 19 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 }, | 177 }, |
| 181 [ | 178 [ |
| 182 '<div contenteditable>', | 179 '<div contenteditable>', |
| 183 'one', | 180 'one', |
| 184 '<div>two</div>', | 181 '<div>two</div>', |
| 185 'tho<br>', | 182 'tho<br>', |
| 186 'th|ree<br>', | 183 'th|ree<br>', |
| 187 '</div>', | 184 '</div>', |
| 188 ].join(''), | 185 ].join(''), |
| 189 '8 Paste with text crossing DIV twice'); | 186 '8 Paste with text crossing DIV twice'); |
| 187 |
| 188 assert_selection( |
| 189 [ |
| 190 '<div contenteditable>', |
| 191 'one', |
| 192 '<div>two^</div>', |
| 193 't|hree', |
| 194 '</div>', |
| 195 ].join(''), |
| 196 selection => { |
| 197 selection.document.execCommand('copy'); |
| 198 selection.document.execCommand('paste'); |
| 199 selection.document.execCommand('paste'); |
| 200 }, |
| 201 [ |
| 202 '<div contenteditable>', |
| 203 'one', |
| 204 '<div>two</div>', |
| 205 't<div>t|hree</div>', |
| 206 '</div>', |
| 207 ].join(''), |
| 208 '9 Paste with text crossing start of DIV'); |
| 190 }, 'Paste text'); | 209 }, 'Paste text'); |
| 191 </script> | 210 </script> |
| OLD | NEW |