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

Unified Diff: LayoutTests/inspector/sources/debugger/properties-special.html

Issue 905743003: DevTools: Reimplemented WI.WatchExpressionsSidebarPane (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix hover 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/properties-special.html
diff --git a/LayoutTests/inspector/sources/debugger/properties-special.html b/LayoutTests/inspector/sources/debugger/properties-special.html
index 6ddbf9ab883c89d4753b849d9c7068d50dbcf259..c1b40ebd17a6155a3ba1c4528212dc1dc050b370 100644
--- a/LayoutTests/inspector/sources/debugger/properties-special.html
+++ b/LayoutTests/inspector/sources/debugger/properties-special.html
@@ -4,56 +4,39 @@
<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);
+ //our callback called twice per each experession
+ var updateCount = 6;
+
InspectorTest.startDebuggerTest(step1);
- var currentSourceFrame;
- var watchExpressionsSection;
+ var watchExpressionsPane;
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("Object(true)");
- watchExpressionsSection.watchExpressions.push("(function(a,b) { return a + b; })");
- watchExpressionsSection.watchExpressions.push("(function(a,b) { return a + b; }).bind({}, 2)");
- watchExpressionsSection.update();
-
- var testName = InspectorTest.resourceTreeModel.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);
- InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
- }
-
- function didPause(callFrames)
- {
+ InspectorTest.addSniffer(WebInspector.WatchExpression.prototype, "_createWatchExpression", watchExpressionsUpdated, true);
pfeldman 2015/02/18 20:51:00 You'll have to rebaseline this.
+ watchExpressionsPane.addExpression("Object(true)");
+ watchExpressionsPane.addExpression("(function(a,b) { return a + b; })");
+ watchExpressionsPane.addExpression("(function(a,b) { return a + b; }).bind({}, 2)");
}
function watchExpressionsUpdated()
{
+ updateCount--;
+ if (updateCount)
+ return;
+
InspectorTest.addResult("Watch expressions updated.");
- var treeNodes = watchExpressionsSection.propertiesTreeOutline.children;
- for (var i = 0; i < treeNodes.length; i++) {
- treeNodes[i].expand();
+
+ for (var i = 0; i < watchExpressionsPane._watchExpressions.length; i++) {
+ var watch = watchExpressionsPane._watchExpressions[i];
+ watch._objectPresentationElement._section.expand();
}
InspectorTest.runAfterPendingDispatches(nodesExpanded);
}
@@ -61,12 +44,16 @@ var test = function()
function nodesExpanded()
{
InspectorTest.addResult("Nodes are expanded.");
- InspectorTest.dumpObjectPropertySectionDeep(watchExpressionsSection);
+ 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 + "'");
+ InspectorTest.dumpObjectPropertySectionDeep(watch._objectPresentationElement._section)
+ }
// Clear watch expressions after execution.
- watchExpressionsSection.watchExpressions = [];
- watchExpressionsSection.update();
-
+ watchExpressionsPane._deleteAllButtonClicked();
InspectorTest.completeDebuggerTest();
}
}

Powered by Google App Engine
This is Rietveld 408576698