| 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"> | 5 <script type="application/dart"> |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 | 8 |
| 9 main() { | 9 main() { |
| 10 window.onMessage.listen(handleMessage); | 10 window.onMessage.listen(handleMessage); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 | 22 |
| 23 </script> | 23 </script> |
| 24 | 24 |
| 25 <script> | 25 <script> |
| 26 function postMessageToDart() | 26 function postMessageToDart() |
| 27 { | 27 { |
| 28 window.postMessage('fromJS', '*'); | 28 window.postMessage('fromJS', '*'); |
| 29 } | 29 } |
| 30 | 30 |
| 31 function testFunction() { |
| 32 postMessageToDart(); |
| 33 } |
| 34 |
| 31 function handleReplyFromDart(event) | 35 function handleReplyFromDart(event) |
| 32 { | 36 { |
| 33 if (event.data == 'fromDart') | 37 if (event.data == 'fromDart') |
| 34 debugger; | 38 debugger; |
| 35 } | 39 } |
| 36 | 40 |
| 37 window.addEventListener('load', function() | 41 window.addEventListener('load', function() |
| 38 { | 42 { |
| 39 window.addEventListener('message', handleReplyFromDart); | 43 window.addEventListener('message', handleReplyFromDart); |
| 40 }); | 44 }); |
| 41 | 45 |
| 42 function test() | 46 function test() |
| 43 { | 47 { |
| 44 InspectorTest.runDebuggerTestSuite([ | 48 InspectorTest.runDebuggerTestSuite([ |
| 45 function testSetBreakpoint(next) | 49 function testSetBreakpoint(next) |
| 46 { | 50 { |
| 47 InspectorTest.showScriptSource('debugger-code-in-html.html', didShow
ScriptSource); | 51 InspectorTest.showScriptSource('debugger-code-in-html.html', didShow
ScriptSource); |
| 48 | 52 |
| 49 function didShowScriptSource(sourceFrame) | 53 function didShowScriptSource(sourceFrame) |
| 50 { | 54 { |
| 51 InspectorTest.setBreakpoint(sourceFrame, 19, '', true); | 55 InspectorTest.setBreakpoint(sourceFrame, 19, '', true); |
| 52 InspectorTest.waitUntilPaused(didPauseInDart); | 56 InspectorTest.runTestFunctionAndWaitUntilPaused(didPauseInDart); |
| 53 InspectorTest.evaluateInPage('postMessageToDart()'); | |
| 54 } | 57 } |
| 55 | 58 |
| 56 function didPauseInDart(callFrames) | 59 function didPauseInDart(callFrames) |
| 57 { | 60 { |
| 58 InspectorTest.captureStackTrace(callFrames, false, true); | 61 InspectorTest.captureStackTrace(callFrames, false, true); |
| 59 InspectorTest.resumeExecution(resumedDart); | 62 InspectorTest.resumeExecution(resumedDart); |
| 60 } | 63 } |
| 61 | 64 |
| 62 function resumedDart() | 65 function resumedDart() |
| 63 { | 66 { |
| 64 InspectorTest.waitUntilPaused(didPauseInJS); | 67 InspectorTest.waitUntilPaused(didPauseInJS); |
| 65 } | 68 } |
| 66 | 69 |
| 67 function didPauseInJS(callFrames) | 70 function didPauseInJS(callFrames) |
| 68 { | 71 { |
| 69 InspectorTest.captureStackTrace(callFrames, false, true); | 72 InspectorTest.captureStackTrace(callFrames, false, true); |
| 70 InspectorTest.resumeExecution(next); | 73 InspectorTest.resumeExecution(next); |
| 71 } | 74 } |
| 72 }, | 75 }, |
| 73 function testRemoveBreakpoint(next) | 76 function testRemoveBreakpoint(next) |
| 74 { | 77 { |
| 75 InspectorTest.showScriptSource('debugger-code-in-html.html', didShow
ScriptSource); | 78 InspectorTest.showScriptSource('debugger-code-in-html.html', didShow
ScriptSource); |
| 76 | 79 |
| 77 function didShowScriptSource(sourceFrame) | 80 function didShowScriptSource(sourceFrame) |
| 78 { | 81 { |
| 79 InspectorTest.removeBreakpoint(sourceFrame, 19); | 82 InspectorTest.removeBreakpoint(sourceFrame, 19); |
| 80 InspectorTest.waitUntilPaused(didPause); | 83 InspectorTest.runTestFunctionAndWaitUntilPaused(didPauseInDart); |
| 81 InspectorTest.evaluateInPage('postMessageToDart()'); | |
| 82 } | 84 } |
| 83 | 85 |
| 84 function didPause(callFrames) | 86 function didPause(callFrames) |
| 85 { | 87 { |
| 86 // Should pause in JS. | 88 // Should pause in JS. |
| 87 InspectorTest.captureStackTrace(callFrames, false, true); | 89 InspectorTest.captureStackTrace(callFrames, false, true); |
| 88 InspectorTest.resumeExecution(next); | 90 InspectorTest.resumeExecution(next); |
| 89 } | 91 } |
| 90 } | 92 } |
| 91 ]); | 93 ]); |
| 92 }; | 94 }; |
| 93 | 95 |
| 94 </script> | 96 </script> |
| 95 | 97 |
| 96 <body onload="runTest()"> | 98 <body onload="runTest()"> |
| 97 </body> | 99 </body> |
| 98 </html> | 100 </html> |
| OLD | NEW |