blob: e55c62aae8816a0d2960927ad2d9c44c7969525d [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<div id="container">
You should run this test with DRT. To test manually, please do following:
<ol>
<li>Select select element in box after "Copy from"</li>
<li>Cut selection into clipboard</li>
<li>Paste it into box below "Paste to"
</ol>
Copy from:
<div id="copy" contenteditable="true" style="border: solid 1px red">
<select id="select">
<option>One</option>
<option>Two</option>
<option>Three</option>
</select>
</div>
Paste to:
<div id="paste" contenteditable="true" style="border: solid 1px red"></div>
</div>
<script>
description('This tests copy/paste of select elements. All the options should be included.');
if (window.testRunner) {
var copy = document.getElementById('copy');
copy.focus();
document.execCommand('SelectAll');
document.execCommand('Cut');
shouldBeTrue('document.getElementById("select") === null');
var paste = document.getElementById('paste');
paste.focus();
document.execCommand('Paste');
var select = document.getElementById('select');
shouldBeEqualToString('select.options[0].value', 'One');
shouldBeEqualToString('select.options[1].value', 'Two');
shouldBeEqualToString('select.options[2].value', 'Three');
document.getElementById('container').outerHTML = '';
}
</script>