Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-panel-switch.html |
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-panel-switch.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-panel-switch.html |
index b2864310d4550c16066c2369436bb0fea01a8c4b..ac9c7eb506d1f2303841b10d3ddb1985e7e1ec4b 100644 |
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-panel-switch.html |
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-panel-switch.html |
@@ -5,66 +5,36 @@ |
<script src="../../../http/tests/inspector/network-test.js"></script> |
<script src="../../../http/tests/inspector/debugger-test.js"></script> |
<script> |
+ |
function testFunction() |
{ |
- var x = Math.sqrt(10); |
+ var x = Math.sqrt(16); |
+ debugger; |
return x; |
} |
-var test = function() |
+function test() |
{ |
InspectorTest.setQuiet(true); |
InspectorTest.startDebuggerTest(step1); |
+ var updateCount = 6; |
dgozman
2016/08/15 21:31:03
8
|
- var currentSourceFrame; |
- var watchExpressionsPane; |
- //callback per each watchExpression called twice: in constructor and when actual evaluation result is available |
- var updateCount = 4; |
+ WebInspector.settings.createLocalSetting("watchExpressions", []).set(["x", "y.foo"]); |
function step1() |
{ |
- watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExpressions; |
- watchExpressionsPane.revealView().then(() => { |
- watchExpressionsPane.addExpression("window.document"); |
- watchExpressionsPane.addExpression("windowa.document"); |
- var testName = InspectorTest.mainTarget.inspectedURL(); |
- testName = testName.substring(testName.lastIndexOf('/') + 1); |
- InspectorTest.showScriptSource(testName, didShowScriptSource); |
+ watchExpressionsPane = self.runtime.sharedInstance(WebInspector.WatchExpressionsSidebarPane); |
+ WebInspector.panels.sources._sidebarPaneStack.showView(WebInspector.panels.sources._watchSidebarPane).then(() => { |
+ InspectorTest.addSniffer(WebInspector.WatchExpression.prototype, "_createWatchExpression", watchExpressionsUpdated, true); |
+ InspectorTest.evaluateInPage("testFunction()"); |
}); |
} |
- function didShowScriptSource(sourceFrame) |
- { |
- currentSourceFrame = sourceFrame; |
- InspectorTest.addResult("Script source was shown."); |
- InspectorTest.setBreakpoint(currentSourceFrame, 9, "", true); |
- InspectorTest.addSniffer(WebInspector.WatchExpression.prototype, "_createWatchExpression", watchExpressionsUpdated, true); |
- // Switch to another panel to test how watch expressions evaluation together with panel switching. |
- WebInspector.NetworkPanel.show(); |
- InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); |
- } |
- |
- function didPause(callFrames) |
- { |
- } |
- |
- function watchExpressionsUpdated() |
+ function watchExpressionsUpdated(result, wasThrown) |
{ |
- updateCount--; |
- if (updateCount) |
- return; |
- |
- InspectorTest.addResult("Watch expressions updated."); |
- |
- for (var i = 0; i < watchExpressionsPane._watchExpressions.length; i++) { |
- var watch = watchExpressionsPane._watchExpressions[i]; |
- var nameElement = watch._objectPresentationElement.querySelector(".name"); |
- var valueElement = watch._objectPresentationElement.querySelector(".value"); |
- InspectorTest.addResult("'" + nameElement.textContent + "'" + " => " + "'" + valueElement.textContent + "'"); |
- } |
- |
- watchExpressionsPane._deleteAllButtonClicked(); |
- InspectorTest.completeDebuggerTest(); |
+ InspectorTest.addResult(this._element.deepTextContent()); |
+ if (--updateCount === 0) |
+ InspectorTest.completeDebuggerTest(); |
} |
} |