OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <script> | 3 <script> |
4 if (window.testRunner) | 4 if (window.testRunner) |
5 testRunner.dumpAsText(); | 5 testRunner.dumpAsText(); |
6 | 6 |
7 function runTest() | 7 function runTest() |
8 { | 8 { |
9 var obj = document.getElementById("test"); | 9 var obj = document.getElementById("test"); |
10 var s = window.getSelection(); | 10 var s = window.getSelection(); |
11 // The cleardocumentduringnew attribute intends to clear document.body when
the | 11 // The initscript attribute is run (synchronously) when the plugin is create
d. |
12 // embed element is loaded and it is used for only tests. See: | |
13 // https://code.google.com/p/chromium/codesearch#chromium/src/content/she
ll/tools/plugin/main.cpp&q=cleardocumentduringnew&type=cs&sq=package:chromium&l=
247 | |
14 // It causes a timing issue that |obj| exists on Linux but not on Windows. | |
15 if (obj) | 12 if (obj) |
16 s.collapse(obj, 0); | 13 s.collapse(obj, 0); |
17 else | 14 else |
18 s.removeAllRanges(); | 15 s.removeAllRanges(); |
19 document.body.innerHTML = "PASS"; | 16 document.body.innerHTML = "PASS"; |
20 } | 17 } |
21 </script> | 18 </script> |
22 <body onload="runTest()"> | 19 <body onload="runTest()"> |
23 <div> | 20 <div> |
24 <object id="test"></object> | 21 <object id="test"></object> |
25 <embed type="application/x-webkit-test-netscape" cleardocumentduringnew></embed> | 22 <embed type="application/x-blink-deprecated-test-plugin" initscript="document.bo
dy.innerHTML = '';"></embed> |
26 </div> | 23 </div> |
27 </body> | 24 </body> |
28 </html> | 25 </html> |
OLD | NEW |