| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | |
| 5 <script> | |
| 6 | |
| 7 function testFunction() | |
| 8 { | |
| 9 for (var name in window) { | |
| 10 if (/^doTest[A-Z]/.test(name) && typeof window[name] === "function") | |
| 11 window[name](); | |
| 12 } | |
| 13 } | |
| 14 | |
| 15 function setSelection(start, end) | |
| 16 { | |
| 17 var node = document.getElementById("content").firstChild; | |
| 18 var range = document.createRange(); | |
| 19 range.setStart(node, start); | |
| 20 range.setEnd(node, end); | |
| 21 var selection = window.getSelection(); | |
| 22 selection.removeAllRanges(); | |
| 23 if (start !== end) | |
| 24 selection.addRange(range); | |
| 25 } | |
| 26 | |
| 27 function doTestSelectionChange() | |
| 28 { | |
| 29 setSelection(0, 0); | |
| 30 document.addEventListener("selectionchange", onSelectionChange, false); | |
| 31 setSelection(0, 4); | |
| 32 setSelection(0, 8); | |
| 33 setSelection(0, 0); | |
| 34 } | |
| 35 | |
| 36 function onSelectionChange() | |
| 37 { | |
| 38 document.removeEventListener("selectionchange", onSelectionChange, false); | |
| 39 debugger; | |
| 40 } | |
| 41 | |
| 42 function doTestHashChange() | |
| 43 { | |
| 44 window.addEventListener("hashchange", onHashChange1, false); | |
| 45 window.addEventListener("hashchange", onHashChange2, true); | |
| 46 location.hash = location.hash + "x"; | |
| 47 } | |
| 48 | |
| 49 function onHashChange1() | |
| 50 { | |
| 51 window.removeEventListener("hashchange", onHashChange1, false); | |
| 52 debugger; | |
| 53 } | |
| 54 | |
| 55 function onHashChange2() | |
| 56 { | |
| 57 window.removeEventListener("hashchange", onHashChange2, true); | |
| 58 debugger; | |
| 59 } | |
| 60 | |
| 61 function doTestMediaEvents() | |
| 62 { | |
| 63 var video = document.getElementById("video"); | |
| 64 video.addEventListener("play", onVideoPlay, false); | |
| 65 video.play(); | |
| 66 } | |
| 67 | |
| 68 function onVideoPlay() | |
| 69 { | |
| 70 video.removeEventListener("play", onVideoPlay, false); | |
| 71 debugger; | |
| 72 } | |
| 73 | |
| 74 var test = function() | |
| 75 { | |
| 76 var totalDebuggerStatements = 4; | |
| 77 var maxAsyncCallStackDepth = 4; | |
| 78 InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallSt
ackDepth); | |
| 79 } | |
| 80 | |
| 81 </script> | |
| 82 </head> | |
| 83 | |
| 84 <body onload="runTest()"> | |
| 85 <video id="video" src="../../../media/content/test.ogv"></video> | |
| 86 <p id="content"> | |
| 87 Tests asynchronous call stacks for various DOM events. | |
| 88 </p> | |
| 89 </body> | |
| 90 </html> | |
| OLD | NEW |