| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 <style> | 5 <style> |
| 6 #drag { | 6 #drag { |
| 7 border: 1px solid black; | 7 border: 1px solid black; |
| 8 height: 200px; | 8 height: 200px; |
| 9 width: 200px; | 9 width: 200px; |
| 10 } | 10 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 dataTransfer.setData('text/html', '<em>Markup</em>'); | 22 dataTransfer.setData('text/html', '<em>Markup</em>'); |
| 23 dataTransfer.setData('custom-data', 'hello world'); | 23 dataTransfer.setData('custom-data', 'hello world'); |
| 24 } | 24 } |
| 25 | 25 |
| 26 var testDataTransfer; | 26 var testDataTransfer; |
| 27 var testItem; | 27 var testItem; |
| 28 function itemListDragStart(dataTransfer) | 28 function itemListDragStart(dataTransfer) |
| 29 { | 29 { |
| 30 testDataTransfer = dataTransfer; | 30 testDataTransfer = dataTransfer; |
| 31 shouldThrow('testDataTransfer.items.add()', '"TypeError: Failed to execute \
'add\' on \'DataTransferItemList\': 1 argument required, but only 0 present."'); | 31 shouldThrow('testDataTransfer.items.add()', '"TypeError: Failed to execute \
'add\' on \'DataTransferItemList\': 1 argument required, but only 0 present."'); |
| 32 shouldThrow('testDataTransfer.items.add("sample")', '"TypeError: Type error"
'); | 32 shouldThrow('testDataTransfer.items.add("sample")', '"TypeError: Failed to e
xecute \'add\' on \'DataTransferItemList\': No function was found that matched t
he signature provided."'); |
| 33 testItem = dataTransfer.items.add('sample', 'text/plain'); | 33 testItem = dataTransfer.items.add('sample', 'text/plain'); |
| 34 shouldBeEqualToString('testItem.kind', 'string'); | 34 shouldBeEqualToString('testItem.kind', 'string'); |
| 35 shouldBeEqualToString('testItem.type', 'text/plain'); | 35 shouldBeEqualToString('testItem.type', 'text/plain'); |
| 36 testItem = dataTransfer.items.add('http://www.google.com/', 'text/uri-list')
; | 36 testItem = dataTransfer.items.add('http://www.google.com/', 'text/uri-list')
; |
| 37 shouldBeEqualToString('testItem.kind', 'string'); | 37 shouldBeEqualToString('testItem.kind', 'string'); |
| 38 shouldBeEqualToString('testItem.type', 'text/uri-list'); | 38 shouldBeEqualToString('testItem.type', 'text/uri-list'); |
| 39 testItem = dataTransfer.items.add('<em>Markup</em>', 'text/html'); | 39 testItem = dataTransfer.items.add('<em>Markup</em>', 'text/html'); |
| 40 shouldBeEqualToString('testItem.kind', 'string'); | 40 shouldBeEqualToString('testItem.kind', 'string'); |
| 41 shouldBeEqualToString('testItem.type', 'text/html'); | 41 shouldBeEqualToString('testItem.type', 'text/html'); |
| 42 testItem = dataTransfer.items.add('hello world', 'custom-data'); | 42 testItem = dataTransfer.items.add('hello world', 'custom-data'); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 <div>Drop handler: <select id="dropMethod"><option>Legacy</option><option>DataTr
ansferItemList</option></select></div> | 184 <div>Drop handler: <select id="dropMethod"><option>Legacy</option><option>DataTr
ansferItemList</option></select></div> |
| 185 <div id="console"></div> | 185 <div id="console"></div> |
| 186 <script> | 186 <script> |
| 187 description("Tests drag'n drop and well as DataTransferItemList"); | 187 description("Tests drag'n drop and well as DataTransferItemList"); |
| 188 window.jsTestIsAsync = true; | 188 window.jsTestIsAsync = true; |
| 189 | 189 |
| 190 runNext(); | 190 runNext(); |
| 191 </script> | 191 </script> |
| 192 </body> | 192 </body> |
| 193 </html> | 193 </html> |
| OLD | NEW |