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 watchExpressionsPane
;
21 //callback per each watchExpression called twice: in constructor and when actual evaluation result is available
26 watchExpressionsPane
= WebInspector
.panels
.sources
.sidebarPanes
.watchExpressions
;
27 watchExpressionsPane
.expand();
28 watchExpressionsPane
.addExpression("window.document");
29 watchExpressionsPane
.addExpression("windowa.document");
31 var testName
= InspectorTest
.resourceTreeModel
.inspectedPageURL();
32 testName
= testName
.substring(testName
.lastIndexOf('/') + 1);
33 InspectorTest
.showScriptSource(testName
, didShowScriptSource
);
36 function didShowScriptSource(sourceFrame
)
38 currentSourceFrame
= sourceFrame
;
39 InspectorTest
.addResult("Script source was shown.");
40 InspectorTest
.setBreakpoint(currentSourceFrame
, 9, "", true);
41 InspectorTest
.addSniffer(WebInspector
.WatchExpression
.prototype, "_createWatchExpression", watchExpressionsUpdated
, true);
42 // Switch to another panel to test how watch expressions evaluation together with panel switching.
43 WebInspector
.NetworkPanel
.show();
44 InspectorTest
.runTestFunctionAndWaitUntilPaused(didPause
);
47 function didPause(callFrames
)
51 function watchExpressionsUpdated()
57 InspectorTest
.addResult("Watch expressions updated.");
59 for (var i
= 0; i
< watchExpressionsPane
._watchExpressions
.length
; i
++) {
60 var watch
= watchExpressionsPane
._watchExpressions
[i
];
61 var nameElement
= watch
._objectPresentationElement
.querySelector(".name");
62 var valueElement
= watch
._objectPresentationElement
.querySelector(".value");
63 InspectorTest
.addResult("'" + nameElement
.textContent
+ "'" + " => " + "'" + valueElement
.textContent
+ "'");
66 watchExpressionsPane
._deleteAllButtonClicked();
67 InspectorTest
.completeDebuggerTest();
73 <body onload=
"runTest()">
74 <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>
75 <a href=
"https://bugs.webkit.org/show_bug.cgi?id=70718">Bug
70718</a>