OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="/inspector/inspector-test.js"></script> | 3 <script src="/inspector/inspector-test.js"></script> |
4 <script src="/inspector/debugger-test.js"></script> | 4 <script src="/inspector/debugger-test.js"></script> |
5 <script src="/inspector/console-test.js"></script> | 5 <script src="/inspector/console-test.js"></script> |
6 <script> | 6 <script> |
7 | 7 |
8 function testFunction() | 8 function testFunction() |
9 { | 9 { |
10 var image = document.createElement("img"); | 10 var image = document.createElement("img"); |
11 image.src = "resources/image.png"; | 11 image.src = "resources/image.png"; |
12 document.body.appendChild(image); | 12 document.body.appendChild(image); |
13 } | 13 } |
14 | 14 |
15 function test() | 15 function test() |
16 { | 16 { |
17 Common.settingForTest("enableAsyncStackTraces").set(true); | 17 Common.settingForTest("enableAsyncStackTraces").set(true); |
18 InspectorTest.evaluateInPage("testFunction()"); | 18 InspectorTest.evaluateInPage("testFunction()"); |
19 InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.Requ
estFinished, requestFinished); | 19 InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.Requ
estFinished, requestFinished); |
20 | 20 |
21 function requestFinished(event) | 21 function requestFinished(event) |
22 { | 22 { |
23 if (!event.data.url().endsWith("resources/image.png")) | 23 if (!event.data.url().endsWith("resources/image.png")) |
24 return; | 24 return; |
25 | 25 |
26 var initiatorInfo = SDK.networkLog.initiatorInfoForRequest(event.data); | 26 var initiatorInfo = NetworkLog.networkLog.initiatorInfoForRequest(event.
data); |
27 var element = new Components.Linkifier().linkifyScriptLocation(Inspector
Test.mainTarget, initiatorInfo.scriptId, initiatorInfo.url, initiatorInfo.lineNu
mber - 1, initiatorInfo.columnNumber - 1); | 27 var element = new Components.Linkifier().linkifyScriptLocation(Inspector
Test.mainTarget, initiatorInfo.scriptId, initiatorInfo.url, initiatorInfo.lineNu
mber - 1, initiatorInfo.columnNumber - 1); |
28 InspectorTest.addResult(element.textContent); | 28 InspectorTest.addResult(element.textContent); |
29 Common.settingForTest("enableAsyncStackTraces").set(false); | 29 Common.settingForTest("enableAsyncStackTraces").set(false); |
30 InspectorTest.completeTest(); | 30 InspectorTest.completeTest(); |
31 } | 31 } |
32 } | 32 } |
33 | 33 |
34 </script> | 34 </script> |
35 </head> | 35 </head> |
36 | 36 |
37 <body onload="runTest()"> | 37 <body onload="runTest()"> |
38 <p> | 38 <p> |
39 Tests asynchronous network initiator for image loaded from JS. | 39 Tests asynchronous network initiator for image loaded from JS. |
40 </p> | 40 </p> |
41 </body> | 41 </body> |
42 </html> | 42 </html> |
OLD | NEW |