| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 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> | |
| 7 <script> | |
| 8 function testFunction() | |
| 9 { | |
| 10 var x = Math.sqrt(10); | |
| 11 return x; | |
| 12 } | |
| 13 | |
| 14 var test = function() | |
| 15 { | |
| 16 InspectorTest.setQuiet(true); | |
| 17 InspectorTest.startDebuggerTest(step1); | |
| 18 | |
| 19 var currentSourceFrame; | |
| 20 var watchExpressionsPane; | |
| 21 //callback per each watchExpression called twice: in constructor and when ac
tual evaluation result is available | |
| 22 var updateCount = 4; | |
| 23 | |
| 24 function step1() | |
| 25 { | |
| 26 watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExp
ressions; | |
| 27 watchExpressionsPane.expand(); | |
| 28 watchExpressionsPane.addExpression("window.document"); | |
| 29 watchExpressionsPane.addExpression("windowa.document"); | |
| 30 | |
| 31 var testName = InspectorTest.resourceTreeModel.inspectedPageURL(); | |
| 32 testName = testName.substring(testName.lastIndexOf('/') + 1); | |
| 33 InspectorTest.showScriptSource(testName, didShowScriptSource); | |
| 34 } | |
| 35 | |
| 36 function didShowScriptSource(sourceFrame) | |
| 37 { | |
| 38 currentSourceFrame = sourceFrame; | |
| 39 InspectorTest.addResult("Script source was shown."); | |
| 40 InspectorTest.setBreakpoint(currentSourceFrame, 9, "", true); | |
| 41 InspectorTest.addSniffer(WebInspector.WatchExpression.prototype, "_creat
eWatchExpression", watchExpressionsUpdated, true); | |
| 42 // Switch to another panel to test how watch expressions evaluation toge
ther with panel switching. | |
| 43 WebInspector.NetworkPanel.show(); | |
| 44 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); | |
| 45 } | |
| 46 | |
| 47 function didPause(callFrames) | |
| 48 { | |
| 49 } | |
| 50 | |
| 51 function watchExpressionsUpdated() | |
| 52 { | |
| 53 updateCount--; | |
| 54 if (updateCount) | |
| 55 return; | |
| 56 | |
| 57 InspectorTest.addResult("Watch expressions updated."); | |
| 58 | |
| 59 for (var i = 0; i < watchExpressionsPane._watchExpressions.length; i++)
{ | |
| 60 var watch = watchExpressionsPane._watchExpressions[i]; | |
| 61 var nameElement = watch._objectPresentationElement.querySelector(".n
ame"); | |
| 62 var valueElement = watch._objectPresentationElement.querySelector(".
value"); | |
| 63 InspectorTest.addResult("'" + nameElement.textContent + "'" + " => "
+ "'" + valueElement.textContent + "'"); | |
| 64 } | |
| 65 | |
| 66 watchExpressionsPane._deleteAllButtonClicked(); | |
| 67 InspectorTest.completeDebuggerTest(); | |
| 68 } | |
| 69 } | |
| 70 | |
| 71 </script> | |
| 72 </head> | |
| 73 <body onload="runTest()"> | |
| 74 <p>Tests debugger does not fail when stopped while a panel other than scripts wa
s opened. Both valid and invalid expressions are added to watch expressions.</p> | |
| 75 <a href="https://bugs.webkit.org/show_bug.cgi?id=70718">Bug 70718</a> | |
| 76 </body> | |
| 77 </html> | |
| OLD | NEW |