OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../js/resources/js-test-pre.js"></script> | 4 <script src="../js/resources/js-test-pre.js"></script> |
5 <script> | 5 <script> |
| 6 var testDataTransfer; |
| 7 var nonConvertibleToString = {toString: function() { throw "Exception in toStrin
g()"; }}; |
6 function legacyCopyStart(dataTransfer) | 8 function legacyCopyStart(dataTransfer) |
7 { | 9 { |
| 10 testDataTransfer = dataTransfer; |
8 dataTransfer.setData('text', 'sample'); | 11 dataTransfer.setData('text', 'sample'); |
9 dataTransfer.setData('url', 'http://www.google.com/'); | 12 dataTransfer.setData('url', 'http://www.google.com/'); |
10 dataTransfer.setData('text/html', '<em>Markup</em>'); | 13 dataTransfer.setData('text/html', '<em>Markup</em>'); |
11 dataTransfer.setData('custom-data', 'hello world'); | 14 dataTransfer.setData('custom-data', 'hello world'); |
| 15 shouldBeEqualToString('testDataTransfer.getData("custom-data")', 'hello worl
d'); |
| 16 shouldThrow('testDataTransfer.clearData(nonConvertibleToString)', '"Exceptio
n in toString()"'); |
| 17 shouldBeEqualToString('testDataTransfer.getData("custom-data")', 'hello worl
d'); |
12 } | 18 } |
13 | 19 |
14 var testDataTransfer; | |
15 function itemListCopyStart(dataTransfer) | 20 function itemListCopyStart(dataTransfer) |
16 { | 21 { |
17 testDataTransfer = dataTransfer; | 22 testDataTransfer = dataTransfer; |
18 shouldBeUndefined('testDataTransfer.items.item'); | 23 shouldBeUndefined('testDataTransfer.items.item'); |
19 dataTransfer.items.add('sample', 'text/plain'); | 24 dataTransfer.items.add('sample', 'text/plain'); |
20 dataTransfer.items.add('http://www.google.com/', 'text/uri-list'); | 25 dataTransfer.items.add('http://www.google.com/', 'text/uri-list'); |
21 dataTransfer.items.add('<em>Markup</em>', 'text/html'); | 26 dataTransfer.items.add('<em>Markup</em>', 'text/html'); |
22 dataTransfer.items.add('hello world', 'custom-data'); | 27 dataTransfer.items.add('hello world', 'custom-data'); |
23 } | 28 } |
24 | 29 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 <script> | 148 <script> |
144 description("Tests copy / paste and DataTransferItemList"); | 149 description("Tests copy / paste and DataTransferItemList"); |
145 | 150 |
146 window.jsTestIsAsync = true; | 151 window.jsTestIsAsync = true; |
147 | 152 |
148 runNext(); | 153 runNext(); |
149 </script> | 154 </script> |
150 <script src="../js/resources/js-test-post.js"></script> | 155 <script src="../js/resources/js-test-post.js"></script> |
151 </body> | 156 </body> |
152 </html> | 157 </html> |
OLD | NEW |