OLD | NEW |
1 <html> | 1 <html> |
2 <script src="../../http/tests/inspector/inspector-test.js"></script> | 2 <script src="../../http/tests/inspector/inspector-test.js"></script> |
3 <script src="../../http/tests/inspector/debugger-test.js"></script> | 3 <script src="../../http/tests/inspector/debugger-test.js"></script> |
4 | 4 |
5 <script type="application/dart" src="scope-variables.dart"></script> | 5 <script type="application/dart" src="merged-callstack.dart"></script> |
| 6 <script src="merged-callstack.js"></script> |
6 | 7 |
7 <script> | 8 <script> |
8 | 9 |
9 function postMessageToDart() | 10 function postMessageToDart() |
10 { | 11 { |
11 window.postMessage('fromJS', '*'); | 12 window.postMessage('fromJS', '*'); |
12 } | 13 } |
13 | 14 |
14 function testFunction() { | 15 function testFunction() { |
15 postMessageToDart(); | 16 postMessageToDart(); |
16 } | 17 } |
17 | 18 |
18 function test() | 19 function test() |
19 { | 20 { |
20 var panel = WebInspector.inspectorView.showPanel("sources"); | 21 var panel = WebInspector.inspectorView.showPanel("sources"); |
21 InspectorTest.runDebuggerTestSuite([ | 22 InspectorTest.runDebuggerTestSuite([ |
22 function testScopeChain(next) | 23 function testScopeChain(next) |
23 { | 24 { |
24 InspectorTest.showScriptSource('scope-variables.dart', didShowScript
Source); | 25 InspectorTest.showScriptSource('merged-callstack.dart', didShowScrip
tSource); |
25 | 26 |
26 function didShowScriptSource(sourceFrame) | 27 function didShowScriptSource(sourceFrame) |
27 { | 28 { |
28 setBreakpointAndWaitUntilPaused(sourceFrame, 23, didPauseInDart)
; | 29 setBreakpointAndWaitUntilPaused(sourceFrame, 25, didPauseInDart)
; |
29 InspectorTest.runTestFunction(); | 30 InspectorTest.runTestFunction(); |
30 } | 31 } |
31 | 32 |
32 function didPauseInDart(callFrames) | 33 function didPauseInDart(callFrames) |
33 { | 34 { |
34 InspectorTest.captureStackTrace(callFrames); | 35 InspectorTest.captureStackTrace(callFrames); |
35 expandScopeChainSections(); | 36 expandScopeChainSections(); |
36 InspectorTest.runAfterPendingDispatches(didExpandScopeChainSecti
ons); | 37 InspectorTest.runAfterPendingDispatches(didExpandScopeChainSecti
ons); |
37 } | 38 } |
38 | 39 |
39 function didExpandScopeChainSections() | 40 function didExpandScopeChainSections() |
40 { | 41 { |
41 dumpScopeChainContents(); | 42 dumpScopeChainContents(); |
42 var sections = WebInspector.inspectorView.currentPanel().sidebar
Panes.scopechain._sections; | |
43 for (var s = 0; s < sections.length; s++) { | |
44 var section = sections[s]; | |
45 | |
46 var properties = section.propertiesForTest; | |
47 for (var i = 0; i < properties.length; ++i) { | |
48 if (properties[i].name == 'a1') { | |
49 var objectId = properties[i].value._objectId; | |
50 RuntimeAgent.callFunctionOn(objectId, "(){return thi
s.toString();}", [], undefined, didCallFunctionOn); | |
51 RuntimeAgent.callFunctionOn(objectId, "function(){re
turn this.toString();}", [], undefined, didCallInvalidFunctionOn); | |
52 break; | |
53 } | |
54 } | |
55 if (!section.expanded) | |
56 InspectorTest.addResult(" <section collapsed>"); | |
57 } | |
58 } | |
59 | |
60 function didCallFunctionOn(error, result, wasThrown) | |
61 { | |
62 InspectorTest.addResult("Inspected value toString(): " + result.
value); | |
63 InspectorTest.resumeExecution(next); | |
64 } | |
65 function didCallInvalidFunctionOn(error, result, wasThrown) | |
66 { | |
67 InspectorTest.addResult("Result of calling invalid function. val
ue: " + result.value + ". exception thrown: " + wasThrown); | |
68 InspectorTest.resumeExecution(next); | 43 InspectorTest.resumeExecution(next); |
69 } | 44 } |
70 } | 45 } |
71 ]); | 46 ]); |
72 | 47 |
73 function expandScopeChainSections() | 48 function expandScopeChainSections() |
74 { | 49 { |
75 var sections = WebInspector.inspectorView.currentPanel().sidebarPanes.sc
opechain._sections; | 50 var sections = WebInspector.inspectorView.currentPanel().sidebarPanes.sc
opechain._sections; |
76 for (var i = 0; i < sections.length; i++) | 51 for (var i = 0; i < sections.length; i++) |
77 sections[i].expand(); | 52 sections[i].expand(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 pausedCallback(callFrames); | 91 pausedCallback(callFrames); |
117 } | 92 } |
118 } | 93 } |
119 }; | 94 }; |
120 </script> | 95 </script> |
121 | 96 |
122 <body onload="runTest()"> | 97 <body onload="runTest()"> |
123 <div id="example_div">Example div</div> | 98 <div id="example_div">Example div</div> |
124 </body> | 99 </body> |
125 </html> | 100 </html> |
OLD | NEW |