| 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="debugger.dart"></script> | 5 <script type="application/dart" src="debugger.dart"></script> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 function postMessageToDart() | 8 |
| 9 { | 9 function testFunction() { |
| 10 window.postMessage('fromJS', '*'); | 10 window.postMessage('fromJS', '*'); |
| 11 } | 11 } |
| 12 | 12 |
| 13 function handleReplyFromDart(event) | 13 function handleReplyFromDart(event) |
| 14 { | 14 { |
| 15 if (event.data == 'fromDart') | 15 if (event.data == 'fromDart') |
| 16 debugger; | 16 debugger; |
| 17 } | 17 } |
| 18 | 18 |
| 19 window.addEventListener('load', function() | 19 window.addEventListener('load', function() |
| 20 { | 20 { |
| 21 window.addEventListener('message', handleReplyFromDart); | 21 window.addEventListener('message', handleReplyFromDart); |
| 22 }); | 22 }); |
| 23 | 23 |
| 24 function test() | 24 function test() |
| 25 { | 25 { |
| 26 var panel = WebInspector.inspectorView.showPanel("sources"); |
| 26 InspectorTest.runDebuggerTestSuite([ | 27 InspectorTest.runDebuggerTestSuite([ |
| 27 function testSetBreakpoint(next) | 28 function testSetBreakpoint(next) |
| 28 { | 29 { |
| 29 InspectorTest.showScriptSource('debugger.dart', didShowScriptSource)
; | 30 InspectorTest.showScriptSource('debugger.dart', didShowScriptSource)
; |
| 30 | 31 |
| 31 function didShowScriptSource(sourceFrame) | 32 function didShowScriptSource(sourceFrame) |
| 32 { | 33 { |
| 33 InspectorTest.setBreakpoint(sourceFrame, 13, '', true); | 34 InspectorTest.setBreakpoint(sourceFrame, 13, '', true); |
| 34 InspectorTest.waitUntilPaused(didPauseInDart); | 35 InspectorTest.runTestFunctionAndWaitUntilPaused(didPauseInDart); |
| 35 InspectorTest.evaluateInPage('postMessageToDart()'); | |
| 36 } | 36 } |
| 37 | 37 |
| 38 function didPauseInDart(callFrames) | 38 function didPauseInDart(callFrames) |
| 39 { | 39 { |
| 40 InspectorTest.captureStackTrace(callFrames, false, true); | 40 InspectorTest.captureStackTrace(callFrames, false, true); |
| 41 InspectorTest.resumeExecution(resumedDart); | 41 InspectorTest.resumeExecution(resumedDart); |
| 42 } | 42 } |
| 43 | 43 |
| 44 function resumedDart() | 44 function resumedDart() |
| 45 { | 45 { |
| 46 InspectorTest.waitUntilPaused(didPauseInJS); | 46 InspectorTest.waitUntilPaused(didPauseInJS); |
| 47 } | 47 } |
| 48 | 48 |
| 49 function didPauseInJS(callFrames) | 49 function didPauseInJS(callFrames) |
| 50 { | 50 { |
| 51 InspectorTest.captureStackTrace(callFrames, false, true); | 51 InspectorTest.captureStackTrace(callFrames, false, true); |
| 52 InspectorTest.resumeExecution(next); | 52 InspectorTest.resumeExecution(next); |
| 53 } | 53 } |
| 54 }, | 54 }, |
| 55 | 55 |
| 56 function testRemoveBreakpoint(next) | 56 function testRemoveBreakpoint(next) |
| 57 { | 57 { |
| 58 InspectorTest.showScriptSource('debugger.dart', didShowScriptSource)
; | 58 InspectorTest.showScriptSource('debugger.dart', didShowScriptSource)
; |
| 59 | 59 |
| 60 function didShowScriptSource(sourceFrame) | 60 function didShowScriptSource(sourceFrame) |
| 61 { | 61 { |
| 62 InspectorTest.removeBreakpoint(sourceFrame, 13); | 62 InspectorTest.removeBreakpoint(sourceFrame, 13); |
| 63 InspectorTest.waitUntilPaused(didPause); | 63 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); |
| 64 InspectorTest.evaluateInPage('postMessageToDart()'); | |
| 65 } | 64 } |
| 66 | 65 |
| 67 function didPause(callFrames) | 66 function didPause(callFrames) |
| 68 { | 67 { |
| 69 // Should pause in JS. | 68 // Should pause in JS. |
| 70 InspectorTest.captureStackTrace(callFrames, false, true); | 69 InspectorTest.captureStackTrace(callFrames, false, true); |
| 71 InspectorTest.resumeExecution(next); | 70 InspectorTest.resumeExecution(next); |
| 72 } | 71 } |
| 73 } | 72 } |
| 74 ]); | 73 ]); |
| 75 }; | 74 }; |
| 76 | 75 |
| 77 </script> | 76 </script> |
| 78 | 77 |
| 79 <body onload="runTest()"> | 78 <body onload="runTest()"> |
| 80 </body> | 79 </body> |
| 81 </html> | 80 </html> |
| OLD | NEW |