|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <head> |
|
4 <title>Test copying text from browser to plugin</title> |
|
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
6 <script type="text/javascript" src="utils.js"></script> |
|
7 |
|
8 <script class="testbody" type="text/javascript"> |
|
9 function runTests() { |
|
10 var text = " some text \n to copy 'n paste " |
|
11 var textElt = document.getElementById("input"); |
|
12 var plugin = document.getElementById("plugin1"); |
|
13 |
|
14 textElt.focus(); |
|
15 textElt.value = text; |
|
16 textElt.select(); |
|
17 SpecialPowers.wrap(textElt).editor.copy(); |
|
18 |
|
19 is(plugin.getClipboardText(), text); |
|
20 |
|
21 SimpleTest.finish(); |
|
22 } |
|
23 |
|
24 SimpleTest.waitForExplicitFinish(); |
|
25 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); |
|
26 |
|
27 </script> |
|
28 </head> |
|
29 |
|
30 <body onload="runTests()"> |
|
31 <embed id="plugin1" type="application/x-test" width="400" height="400"></embed> |
|
32 <textarea id="input"></textarea> |
|
33 |
|
34 </body> |
|
35 </html> |