4 https://bugzilla.mozilla.org/show_bug.cgi?id=1148593
8 <title>Test for Bug
1148593</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
11 <script type=
"application/javascript">
12 /* global noSuchFunction */
14 /** Test for Bug
1148593 **/
16 SimpleTest.waitForExplicitFinish();
29 function checkStack(functionName) {
33 ok(e.stack.includes(functionName),
"stack includes " + functionName);
38 function eventListener() {
39 checkStack(
"registerEventListener");
41 function registerEventListener(link) {
42 link.onload = eventListener;
44 function eventTest() {
45 var link = document.createElement(
"link");
46 link.rel =
"stylesheet";
47 link.href =
"data:text/css,";
48 registerEventListener(link);
49 document.body.appendChild(link);
52 function xhrListener() {
53 checkStack(
"xhrTest");
56 var ourFile = location.href;
57 var x = new XMLHttpRequest();
58 x.onload = xhrListener;
59 x.open(
"get", ourFile, true);
63 function rafListener() {
64 checkStack(
"rafTest");
67 requestAnimationFrame(rafListener);
71 function intervalHandler() {
72 clearInterval(intervalId);
73 checkStack(
"intervalTest");
75 function intervalTest() {
76 intervalId = setInterval(intervalHandler,
5);
79 function postMessageHandler(ev) {
81 checkStack(
"postMessageTest");
83 function postMessageTest() {
84 window.addEventListener(
"message", postMessageHandler, true);
85 window.postMessage(
"whatever",
"*");
89 TESTS = [postMessageTest, intervalTest, rafTest, xhrTest, eventTest];
93 addLoadEvent(function() {
94 SpecialPowers.pushPrefEnv(
95 {
"set": [[
"javascript.options.asyncstack_capture_debuggee_only", false]]},
101 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1148593">Mozilla Bug
1148593</a>
103 <div id=
"content" style=
"display: none">