Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: LayoutTests/inspector/sources/debugger/watch-expressions-panel-switch.html

Issue 905743003: DevTools: Reimplemented WI.WatchExpressionsSidebarPane (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/inspector/sources/debugger/watch-expressions-panel-switch.html
diff --git a/LayoutTests/inspector/sources/debugger/watch-expressions-panel-switch.html b/LayoutTests/inspector/sources/debugger/watch-expressions-panel-switch.html
index a01144bf28154e217b6d183524f5f24138e3d0db..dcfd0082f2516a2f5e2cc37c119b4c8decbb4a33 100644
--- a/LayoutTests/inspector/sources/debugger/watch-expressions-panel-switch.html
+++ b/LayoutTests/inspector/sources/debugger/watch-expressions-panel-switch.html
@@ -17,18 +17,16 @@ var test = function()
InspectorTest.startDebuggerTest(step1);
var currentSourceFrame;
- var watchExpressionsSection;
+ var watchExpressionsPane;
+ //callback per each watchExpression called twice: in constructor and when actual evaluation result is available
+ var updateCount = 4;
function step1()
{
- var watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExpressions;
+ watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExpressions;
watchExpressionsPane.expand();
-
- watchExpressionsSection = watchExpressionsPane.section;
- watchExpressionsSection.watchExpressions = [];
- watchExpressionsSection.watchExpressions.push("window.document");
- watchExpressionsSection.watchExpressions.push("windowa.document");
- watchExpressionsSection.update();
+ watchExpressionsPane.addExpression("window.document");
+ watchExpressionsPane.addExpression("windowa.document");
var testName = InspectorTest.resourceTreeModel.inspectedPageURL();
testName = testName.substring(testName.lastIndexOf('/') + 1);
@@ -40,7 +38,7 @@ var test = function()
currentSourceFrame = sourceFrame;
InspectorTest.addResult("Script source was shown.");
InspectorTest.setBreakpoint(currentSourceFrame, 9, "", true);
- InspectorTest.addSniffer(WebInspector.WatchExpressionsSection.prototype, "update", watchExpressionsUpdated);
+ 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);
@@ -52,13 +50,20 @@ var test = function()
function watchExpressionsUpdated()
{
+ updateCount--;
+ if (updateCount)
+ return;
+
InspectorTest.addResult("Watch expressions updated.");
- InspectorTest.dumpObjectPropertySection(watchExpressionsSection, {});
- // Clear watch expressions after execution.
- watchExpressionsSection.watchExpressions = [];
- watchExpressionsSection.update();
+ 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();
}
}

Powered by Google App Engine
This is Rietveld 408576698