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

Unified Diff: LayoutTests/http/tests/inspector/elements-test.js

Issue 467233002: DevTools: Make sure ElementsTreeOutline is correctly rendered when element's hasChildren state chan… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments addressed Created 6 years, 4 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 | LayoutTests/inspector/elements/edit-dom-actions-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/inspector/elements-test.js
diff --git a/LayoutTests/http/tests/inspector/elements-test.js b/LayoutTests/http/tests/inspector/elements-test.js
index 1a969179c196feead1957add3bca67a962b7eca9..1d1a46658473e64db0683a8da1c7a1aef0573c49 100644
--- a/LayoutTests/http/tests/inspector/elements-test.js
+++ b/LayoutTests/http/tests/inspector/elements-test.js
@@ -504,14 +504,19 @@ InspectorTest.dumpElementsTree = function(rootNode, depth, resultsArray)
InspectorTest.expandElementsTree = function(callback)
{
+ var expandedSomething = false;
callback = InspectorTest.safeWrap(callback);
function expand(treeItem)
{
var children = treeItem.children;
for (var i = 0; children && i < children.length; ++i) {
- children[i].expand();
- expand(children[i]);
+ var child = children[i];
+ if (child.hasChildren && !child.expanded) {
+ child.expand();
+ expandedSomething = true;
+ }
+ expand(child);
}
}
@@ -519,7 +524,7 @@ InspectorTest.expandElementsTree = function(callback)
{
InspectorTest.firstElementsTreeOutline()._updateModifiedNodes();
expand(InspectorTest.firstElementsTreeOutline());
- callback();
+ callback(expandedSomething);
}
WebInspector.inspectorView.showPanel("elements");
InspectorTest.findNode(function() { return false; }, onAllNodesAvailable);
@@ -571,21 +576,48 @@ InspectorTest.generateUndoTest = function(testBody)
{
InspectorTest.addResult("Post-action:");
InspectorTest.dumpElementsTree(testNode);
- WebInspector.domModel.undo(redo);
+ InspectorTest.expandElementsTree(expandedCallback);
+
+ function expandedCallback(expandedSomething)
+ {
+ if (expandedSomething) {
+ InspectorTest.addResult("== Expanded: ==");
+ InspectorTest.dumpElementsTree(testNode);
+ }
+ WebInspector.domModel.undo(redo);
+ }
}
function redo()
{
InspectorTest.addResult("Post-undo (initial):");
InspectorTest.dumpElementsTree(testNode);
- WebInspector.domModel.redo(done);
+ InspectorTest.expandElementsTree(expandedCallback);
+
+ function expandedCallback(expandedSomething)
+ {
+ if (expandedSomething) {
+ InspectorTest.addResult("== Expanded: ==");
+ InspectorTest.dumpElementsTree(testNode);
+ }
+ WebInspector.domModel.redo(done);
+ }
}
function done()
{
InspectorTest.addResult("Post-redo (action):");
InspectorTest.dumpElementsTree(testNode);
- next();
+ InspectorTest.expandElementsTree(expandedCallback);
+
+ function expandedCallback(expandedSomething)
+ {
+ if (expandedSomething) {
+ InspectorTest.addResult("== Expanded: ==");
+ InspectorTest.dumpElementsTree(testNode);
+ }
+ next();
+ }
}
}
result.toString = function()
« no previous file with comments | « no previous file | LayoutTests/inspector/elements/edit-dom-actions-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698