| <p>Simple test that custom clipboard MIME types can be set during copy events |
| and retrieved during paste events. The test can be manually run by copying |
| any text on this page and then pasting anywhere. On success, the word SUCCESS |
| event.clipboardData.setData('text', 'sample'); |
| event.clipboardData.setData('custom-data', 'hello world'); |
| if (event.clipboardData.types.indexOf('text/plain') < 0 |
| || event.clipboardData.types.indexOf('custom-data') < 0) |
| if (event.clipboardData.getData('text') != 'sample' |
| || event.clipboardData.getData('custom-data') != 'hello world') |
| document.getElementById('log').innerText = failed ? 'FAILURE' : 'SUCCESS'; |
| document.body.addEventListener('copy', copy); |
| document.body.addEventListener('paste', paste); |
| document.execCommand('copy'); |
| document.execCommand('paste'); |