3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
7 function testFunction()
9 for (var name
in window
) {
10 if (/^doTest[A-Z]/.test(name
) && typeof window
[name
] === "function")
15 function setSelection(start
, end
)
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();
24 selection
.addRange(range
);
27 function doTestSelectionChange()
30 document
.addEventListener("selectionchange", onSelectionChange
, false);
36 function onSelectionChange()
38 document
.removeEventListener("selectionchange", onSelectionChange
, false);
42 function doTestHashChange()
44 window
.addEventListener("hashchange", onHashChange1
, false);
45 window
.addEventListener("hashchange", onHashChange2
, true);
46 location
.hash
= location
.hash
+ "x";
49 function onHashChange1()
51 window
.removeEventListener("hashchange", onHashChange1
, false);
55 function onHashChange2()
57 window
.removeEventListener("hashchange", onHashChange2
, true);
61 function doTestMediaEvents()
63 var video
= document
.getElementById("video");
64 video
.addEventListener("play", onVideoPlay
, false);
68 function onVideoPlay()
70 video
.removeEventListener("play", onVideoPlay
, false);
76 var totalDebuggerStatements
= 4;
77 var maxAsyncCallStackDepth
= 4;
78 InspectorTest
.runAsyncCallStacksTest(totalDebuggerStatements
, maxAsyncCallStackDepth
);
84 <body onload=
"runTest()">
85 <video id=
"video" src=
"../../../media/content/test.ogv"></video>
87 Tests asynchronous call stacks for various DOM events.