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

Unified Diff: LayoutTests/inspector/profiler/heap-snapshot-summary-search-by-id.html

Issue 696703003: DevTools: implement search for CPUProfiler FlameChart view (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comments addressed Created 6 years, 1 month 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/profiler/heap-snapshot-summary-search-by-id.html
diff --git a/LayoutTests/inspector/profiler/heap-snapshot-summary-search-by-id.html b/LayoutTests/inspector/profiler/heap-snapshot-summary-search-by-id.html
index 01becbcb836db3c139ae9d3be960696ddf0a1abf..e99c53af664160b3e8707bf5cc731e7307b278e2 100644
--- a/LayoutTests/inspector/profiler/heap-snapshot-summary-search-by-id.html
+++ b/LayoutTests/inspector/profiler/heap-snapshot-summary-search-by-id.html
@@ -23,53 +23,56 @@ function test()
}
var view;
- function step2()
+ function addNodeHighlightSniffer(constructorName, nodeId, onSuccess)
{
- view = InspectorTest.currentProfileView();
- view.performSearch("@101", checkNodeIsHighlighted.bind(this, "A", "101", step3));
+ InspectorTest.addSniffer(view, "_didHighlightById", checkNodeIsHighlighted.bind(view, constructorName, nodeId, onSuccess));
}
- function step3()
+ function step2()
{
- view.searchCanceled();
- view.performSearch("@a", step4);
+ view = InspectorTest.currentProfileView();
+ addNodeHighlightSniffer("A", "101", step3);
+ view.performSearch({query:"@101", caseSensitive: false});
}
- function step4(view, resultCount)
+ function step3()
{
- if (resultCount !== 0) {
+ view.performSearch({query: "@a", caseSensitive: false});
+ if (view._searchResults.length !== 0) {
InspectorTest.addResult("FAIL: node @a found");
return next();
}
- view.searchCanceled();
- view.performSearch("@999", step5);
+ InspectorTest.addResult("PASS: node @a was not found");
+ InspectorTest.addSniffer(view, "_didHighlightById", step5);
+ view.performSearch({query: "@999", caseSensitive: false}, step5);
}
- function step5(view, resultCount)
+ function step5(found)
{
- if (resultCount !== 0) {
+ if (found) {
InspectorTest.addResult("FAIL: found node @999");
return next();
}
- view.searchCanceled();
- view.performSearch("@100", checkNodeIsHighlighted.bind(this, "B", "100", step6));
+ InspectorTest.addResult("PASS: node @999 was not found");
+ addNodeHighlightSniffer("B", "100", step6);
+ view.performSearch({query: "@100", caseSensitive: false});
}
function step6()
{
- view.searchCanceled();
- view.performSearch("@400", checkNodeIsHighlighted.bind(this, "B", "400", step7));
+ addNodeHighlightSniffer("B", "400", step7);
+ view.performSearch({query: "@400", caseSensitive: false});
}
function step7()
{
- view.searchCanceled();
- view.performSearch("@401", checkNodeIsHighlighted.bind(this, "A", "401", next));
+ addNodeHighlightSniffer("A", "401", next);
+ view.performSearch({query: "@401", caseSensitive: false});
}
- function checkNodeIsHighlighted(constructorName, nodeId, onSuccess, view, resultCount)
+ function checkNodeIsHighlighted(constructorName, nodeId, onSuccess, found)
{
- if (resultCount !== 1) {
+ if (!found) {
InspectorTest.addResult("FAIL: node @" + nodeId + " not found");
return next();
}
@@ -94,6 +97,7 @@ function test()
if (constructorsGrid._nodeToHighlightAfterScroll === instanceNodes[i]) {
function afterScroll(nodeToHighlight)
{
+ InspectorTest.addResult("PASS: found node @" + nodeId + " with class '" + constructorName + "'");
onSuccess();
}
InspectorTest.addSniffer(WebInspector.HeapSnapshotSortableDataGrid.prototype, "highlightNode", afterScroll);
@@ -103,6 +107,7 @@ function test()
return next();
}
}
+ InspectorTest.addResult("PASS: found node @" + nodeId + " with class '" + constructorName + "'");
return onSuccess();
}
}

Powered by Google App Engine
This is Rietveld 408576698