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