3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script src="../../../http/tests/inspector/live-edit-test.js"></script>
6 <script src="resources/edit-me-when-paused-no-reveal.js"></script>
12 var panel = WebInspector.inspectorView.showPanel("sources");
15 InspectorTest.runDebuggerTestSuite([
16 function testLiveEditWhenPausedDoesNotCauseCursorMove(next)
18 InspectorTest.showScriptSource("edit-me-when-paused-no-reveal.js", didShowScriptSource);
20 function didShowScriptSource(sourceFrame)
22 InspectorTest.waitUntilPaused(paused);
23 InspectorTest.evaluateInPage("f1()", didEvaluateInPage);
26 function paused(callFrames)
28 sourceFrame = panel.visibleView;
29 InspectorTest.addSniffer(WebInspector.debuggerModel, "_didEditScriptSource", didEditScriptSource);
30 InspectorTest.replaceInSource(sourceFrame, "return 1;", "return 2;\n\n\n\n");
31 InspectorTest.addResult("Moving cursor to (0, 0).");
32 sourceFrame.setSelection(WebInspector.TextRange.createFromLocation(0, 0));
33 InspectorTest.addResult("Committing live edit.");
34 InspectorTest.commitSource(sourceFrame);
37 function didEditScriptSource()
39 InspectorTest.resumeExecution();
42 function didEvaluateInPage(result)
44 var selection = sourceFrame.textEditor.selection();
45 InspectorTest.addResult("Cursor position is: (" + selection.startLine + ", " +selection.startColumn + ").");
46 InspectorTest.assertEquals(sourceFrame, panel.visibleView, "Another file editor is open.");
57 <body onload="runTest()">
58 <p>Tests live edit feature.</p>