Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / execCommand / replaceSelectorCommand-crash.html
blob566b01f94397f337d12ec9adbc4f39556c608304
1 <!DOCTYPE html>
2 <script>
3 if (window.testRunner) {
4 testRunner.waitUntilDone();
5 testRunner.dumpAsText();
8 var af = [], i = 0;
9 var setIntervalId;
10 var done = false;
12 function main() {
13 if (done)
14 return;
16 if (i == 20 * af.length) {
17 done = true;
18 document.body.innerHTML += "<p>Test for crbug.com/338982. Passes if it does not crash</p>";
19 document.body.innerHTML += "<p>PASS</p>";
20 clearInterval(setIntervalId);
21 if (window.testRunner)
22 testRunner.notifyDone();
23 return;
26 af[i++ % af.length]();
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)
37 });
39 af.push(function() {
40 document.execCommand("Underline", false);
41 });
43 af.push(function() {
44 try {
45 window._Selection_0 = window._Document_0.getSelection();
46 } catch(e) {
47 console.log(e)
49 });
51 af.push(function() {
52 document.execCommand("InsertParagraph");
53 });
55 af.push(function() {
56 try {
57 window._Selection_0.modify("move", "forward", "line");
58 } catch(e) {
59 console.log(e)
61 document.execCommand("Delete", false);
62 });
64 af.push(function() {
65 document.execCommand("Indent");
66 });
68 af.push(function() {
69 document.execCommand("InsertOrderedList");
70 document.execCommand("InsertImage", false);
71 });
73 af.push(function() {});
74 af.push(function() {});
75 af.push(function() {});
77 document.addEventListener("DOMNodeInserted", main, false);
78 setIntervalId = setInterval(main, 10);
79 </script>
80 <input>