OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script> |
| 3 if (window.testRunner) { |
| 4 testRunner.waitUntilDone(); |
| 5 testRunner.dumpAsText(); |
| 6 } |
| 7 |
| 8 var af = [], i = 0; |
| 9 var setIntervalId; |
| 10 var done = false; |
| 11 |
| 12 function main() { |
| 13 if (done) |
| 14 return; |
| 15 |
| 16 if (i == 20 * af.length) { |
| 17 done = true; |
| 18 document.body.innerHTML += "<p>Test for crbug.com/338982. Passes if it doe
s not crash</p>"; |
| 19 document.body.innerHTML += "<p>PASS</p>"; |
| 20 clearInterval(setIntervalId); |
| 21 if (window.testRunner) |
| 22 testRunner.notifyDone(); |
| 23 return; |
| 24 } |
| 25 |
| 26 af[i++ % af.length](); |
| 27 } |
| 28 |
| 29 af.push(function() { |
| 30 document.designMode="on"; |
| 31 document.execCommand("SelectAll"); |
| 32 try { |
| 33 window._Document_0 = document; |
| 34 } catch(e) { |
| 35 console.log(e) |
| 36 }; |
| 37 }); |
| 38 |
| 39 af.push(function() { |
| 40 document.execCommand("Underline", false); |
| 41 }); |
| 42 |
| 43 af.push(function() { |
| 44 try { |
| 45 window._Selection_0 = window._Document_0.getSelection(); |
| 46 } catch(e) { |
| 47 console.log(e) |
| 48 }; |
| 49 }); |
| 50 |
| 51 af.push(function() { |
| 52 document.execCommand("InsertParagraph"); |
| 53 }); |
| 54 |
| 55 af.push(function() { |
| 56 try { |
| 57 window._Selection_0.modify("move", "forward", "line"); |
| 58 } catch(e) { |
| 59 console.log(e) |
| 60 } |
| 61 document.execCommand("Delete", false); |
| 62 }); |
| 63 |
| 64 af.push(function() { |
| 65 document.execCommand("Indent"); |
| 66 }); |
| 67 |
| 68 af.push(function() { |
| 69 document.execCommand("InsertOrderedList"); |
| 70 document.execCommand("InsertImage", false); |
| 71 }); |
| 72 |
| 73 af.push(function() {}); |
| 74 af.push(function() {}); |
| 75 af.push(function() {}); |
| 76 |
| 77 document.addEventListener("DOMNodeInserted", main, false); |
| 78 setIntervalId = setInterval(main, 10); |
| 79 </script> |
| 80 <input> |
OLD | NEW |