| <html> |
| <head> |
| <script src="../../http/tests/inspector/inspector-test.js"></script> |
| <script src="../../http/tests/inspector/debugger-test.js"></script> |
| <script src="../../http/tests/inspector/elements-test.js"></script> |
| <script> |
| function testFunction() |
| { |
| var x = Math.sqrt(10); |
| return x; |
| } |
| |
| var test = function() |
| { |
| InspectorTest.setQuiet(true); |
| InspectorTest.startDebuggerTest(step1); |
| |
| var currentSourceFrame; |
| var watchExpressionsSection; |
| |
| function step1() |
| { |
| // We need to initialize scripts panel so that watch expressions section is created. |
| WebInspector.showPanel("scripts"); |
| |
| var watchExpressionsPane = WebInspector.panels.scripts.sidebarPanes.watchExpressions; |
| watchExpressionsPane.expand(); |
| |
| watchExpressionsSection = watchExpressionsPane.section; |
| watchExpressionsSection.watchExpressions = []; |
| watchExpressionsSection.watchExpressions.push("window.document"); |
| watchExpressionsSection.watchExpressions.push("windowa.document"); |
| watchExpressionsSection.update(); |
| |
| var testName = WebInspector.inspectedPageURL; |
| testName = testName.substring(testName.lastIndexOf('/') + 1); |
| InspectorTest.showScriptSource(testName, didShowScriptSource); |
| } |
| |
| function didShowScriptSource(sourceFrame) |
| { |
| currentSourceFrame = sourceFrame; |
| InspectorTest.addResult("Script source was shown."); |
| InspectorTest.setBreakpoint(currentSourceFrame, 9, "", true); |
| InspectorTest.addSniffer(WebInspector.WatchExpressionsSection.prototype, "update", watchExpressionsUpdated); |
| // Switch to another panel to test how watch expressions evaluation together with panel switching. |
| WebInspector.showPanel("network"); |
| InspectorTest.runTestFunctionAndWaitUntilPaused(didPaused); |
| } |
| |
| function didPaused(callFrames) |
| { |
| } |
| |
| function watchExpressionsUpdated() |
| { |
| InspectorTest.addResult("Watch expressions updated."); |
| InspectorTest.dumpObjectPropertySection(watchExpressionsSection, {}); |
| |
| // Clear watch expressions after execution. |
| watchExpressionsSection.watchExpressions = []; |
| watchExpressionsSection.update(); |
| |
| InspectorTest.completeDebuggerTest(); |
| } |
| } |
| |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <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> |
| <a href="https://bugs.webkit.org/show_bug.cgi?id=70718">Bug 70718</a> |
| </body> |
| </html> |