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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-preserve-expansion.html

Issue 1592973002: Devtools: Fix auto-expanding of arrays and function scopes in watches (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-preserve-expansion-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-preserve-expansion.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-preserve-expansion.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-preserve-expansion.html
index 46e588df9644e2db3d6f66874f8d1f92f9cf87a4..3006a6106f7324f88fcaaf671b4e14a8877d4ae1 100644
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-preserve-expansion.html
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-preserve-expansion.html
@@ -13,6 +13,16 @@ var globalObject = {
}
};
var windowAlias = window;
+var array = [];
+for (var i = 0; i < 300; ++i)
+ array[i] = i;
+
+(function()
+{
+ var a = 10;
+ var b = 100;
+ window.func = function() {return a + b;}
+}());
var test = function()
{
@@ -20,12 +30,16 @@ var test = function()
watchExpressionsPane.expand();
watchExpressionsPane.addExpression("globalObject");
watchExpressionsPane.addExpression("windowAlias");
+ watchExpressionsPane.addExpression("array");
+ watchExpressionsPane.addExpression("func");
InspectorTest.runAfterPendingDispatches(step2);
function step2()
{
InspectorTest.addResult("Watch expressions added.");
- expandWatchExpression(["globalObject", "foo", "bar"], step3);
+ var expandArray = expandWatchExpression.bind(null, ["array", "[200 \u2026 299]", "299"], step3);
+ var expandFunc = expandWatchExpression.bind(null, ["func", "<function scope>", "Closure", "a"], expandArray);
+ expandWatchExpression(["globalObject", "foo", "bar"], expandFunc);
}
function step3()
@@ -56,7 +70,10 @@ var test = function()
function dumpObjectPropertiesTreeElement(treeElement, indent)
{
if (treeElement.property)
- InspectorTest.addResult(indent + treeElement.property.name + ": " + treeElement.property.value._description);
+ addResult(indent + treeElement.property.name + ": " + treeElement.property.value._description);
+ else if (typeof treeElement.title === "string")
+ addResult(indent + treeElement.title);
+
for (var i = 0; i < treeElement.children().length; i++)
dumpObjectPropertiesTreeElement(treeElement.children()[i], " " + indent);
}
@@ -69,11 +86,12 @@ var test = function()
function elementAttached(event)
{
var treeElement = event.data;
- if (treeElement.property.name !== path[0])
+ var currentName = treeElement.property ? treeElement.property.name : treeElement.title;
+ if (currentName !== path[0])
return;
var childName = path.shift();
- InspectorTest.addResult("expanded " + childName + " " + treeElement.property.value);
+ addResult("expanded " + childName + " " + (treeElement.property ? treeElement.property.value : ""));
if (path.length) {
treeElement.expand();
@@ -96,7 +114,11 @@ var test = function()
break;
}
}
+ }
+ function addResult(string)
+ {
+ InspectorTest.addResult(string.replace("\u2026", ".."));
}
}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-preserve-expansion-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698