3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
5 <script src="../../../http/tests/inspector/network-test.js"></script>
6 <script src="../../../http/tests/inspector/debugger-test.js"></script>
8 function testFunction()
10 var x = Math.sqrt(10);
16 InspectorTest.setQuiet(true);
17 InspectorTest.startDebuggerTest(step1);
19 var currentSourceFrame;
20 var watchExpressionsSection;
24 var watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExpressions;
25 watchExpressionsPane.expand();
27 watchExpressionsSection = watchExpressionsPane.section;
28 watchExpressionsSection.watchExpressions = [];
29 watchExpressionsSection.watchExpressions.push("window.document");
30 watchExpressionsSection.watchExpressions.push("windowa.document");
31 watchExpressionsSection.update();
33 var testName = WebInspector.resourceTreeModel.inspectedPageURL();
34 testName = testName.substring(testName.lastIndexOf('/') + 1);
35 InspectorTest.showScriptSource(testName, didShowScriptSource);
38 function didShowScriptSource(sourceFrame)
40 currentSourceFrame = sourceFrame;
41 InspectorTest.addResult("Script source was shown.");
42 InspectorTest.setBreakpoint(currentSourceFrame, 9, "", true);
43 InspectorTest.addSniffer(WebInspector.WatchExpressionsSection.prototype, "update", watchExpressionsUpdated);
44 // Switch to another panel to test how watch expressions evaluation together with panel switching.
45 WebInspector.NetworkPanel.show();
46 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
49 function didPause(callFrames)
53 function watchExpressionsUpdated()
55 InspectorTest.addResult("Watch expressions updated.");
56 InspectorTest.dumpObjectPropertySection(watchExpressionsSection, {});
58 // Clear watch expressions after execution.
59 watchExpressionsSection.watchExpressions = [];
60 watchExpressionsSection.update();
62 InspectorTest.completeDebuggerTest();
68 <body onload="runTest()">
69 <p>Tests debugger does not fail when stopped while a panel other than scripts was opened. Both valid and invalid expressions are added to watch expressions.</p>
70 <a href="https://bugs.webkit.org/show_bug.cgi?id=70718">Bug 70718</a>