| Index: LayoutTests/dart/inspector/debugger.html
|
| diff --git a/LayoutTests/dart/inspector/debugger.html b/LayoutTests/dart/inspector/debugger.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8eb1f6941f7515c82402d79e871d20d2b575fc43
|
| --- /dev/null
|
| +++ b/LayoutTests/dart/inspector/debugger.html
|
| @@ -0,0 +1,102 @@
|
| +<html>
|
| +<script src="../../http/tests/inspector/inspector-test.js"></script>
|
| +<script src="../../http/tests/inspector/debugger-test.js"></script>
|
| +
|
| +<script type="application/dart" src="debugger.dart"></script>
|
| +
|
| +<script>
|
| +
|
| +function testFunction() {
|
| + window.postMessage('fromJS', '*');
|
| +}
|
| +
|
| +function handleReplyFromDart(event)
|
| +{
|
| + if (event.data == 'fromDart')
|
| + debugger;
|
| +}
|
| +
|
| +window.addEventListener('load', function()
|
| +{
|
| + window.addEventListener('message', handleReplyFromDart);
|
| +});
|
| +
|
| +function test()
|
| +{
|
| + var panel = WebInspector.inspectorView.showPanel("sources");
|
| + InspectorTest.runDebuggerTestSuite([
|
| + function testSetBreakpoint(next)
|
| + {
|
| + InspectorTest.showScriptSource('debugger.dart', didShowScriptSource);
|
| +
|
| + function didShowScriptSource(sourceFrame)
|
| + {
|
| + setBreakpointAndWaitUntilPaused(sourceFrame, 13, didPauseInDart);
|
| + InspectorTest.runTestFunction();
|
| + }
|
| +
|
| + function didPauseInDart(callFrames)
|
| + {
|
| + InspectorTest.captureStackTrace(callFrames, false, true);
|
| + InspectorTest.resumeExecution(resumedDart);
|
| + }
|
| +
|
| + function resumedDart()
|
| + {
|
| + InspectorTest.waitUntilPaused(didPauseInJS);
|
| + }
|
| +
|
| + function didPauseInJS(callFrames)
|
| + {
|
| + InspectorTest.captureStackTrace(callFrames, false, true);
|
| + InspectorTest.resumeExecution(next);
|
| + }
|
| + },
|
| +
|
| + function testRemoveBreakpoint(next)
|
| + {
|
| + InspectorTest.showScriptSource('debugger.dart', didShowScriptSource);
|
| +
|
| + function didShowScriptSource(sourceFrame)
|
| + {
|
| + InspectorTest.removeBreakpoint(sourceFrame, 13);
|
| + InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
|
| + }
|
| +
|
| + function didPause(callFrames)
|
| + {
|
| + // Should pause in JS.
|
| + InspectorTest.captureStackTrace(callFrames, false, true);
|
| + InspectorTest.resumeExecution(next);
|
| + }
|
| + }
|
| + ]);
|
| +
|
| + function setBreakpointAndWaitUntilPaused(sourceFrame, lineNumber, pausedCallback)
|
| + {
|
| + var expectedBreakpointId;
|
| + InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", didSetBreakpointInDebugger);
|
| + InspectorTest.setBreakpoint(sourceFrame, lineNumber, "", true);
|
| +
|
| + function didSetBreakpointInDebugger(callback, breakpointId)
|
| + {
|
| + expectedBreakpointId = breakpointId;
|
| + InspectorTest.waitUntilPaused(didPause);
|
| + }
|
| +
|
| + function didPause(callFrames, reason, breakpointIds)
|
| + {
|
| + InspectorTest.assertEquals(breakpointIds.length, 1);
|
| + InspectorTest.assertEquals(breakpointIds[0], expectedBreakpointId);
|
| + InspectorTest.assertEquals(reason, "other");
|
| +
|
| + pausedCallback(callFrames);
|
| + }
|
| + }
|
| +};
|
| +
|
| +</script>
|
| +
|
| +<body onload="runTest()">
|
| +</body>
|
| +</html>
|
|
|