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

Unified Diff: LayoutTests/inspector/profiler/heap-snapshot-summary-search.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
« no previous file with comments | « no previous file | LayoutTests/inspector/profiler/heap-snapshot-summary-search-by-id.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/profiler/heap-snapshot-summary-search.html
diff --git a/LayoutTests/inspector/profiler/heap-snapshot-summary-search.html b/LayoutTests/inspector/profiler/heap-snapshot-summary-search.html
index ea3c8e0958d9fd21dcc77db8853727e004940ea9..e0f305f4c84e7d4fd11291f0a80168f6de08ec10 100644
--- a/LayoutTests/inspector/profiler/heap-snapshot-summary-search.html
+++ b/LayoutTests/inspector/profiler/heap-snapshot-summary-search.html
@@ -16,6 +16,19 @@ function test()
function testSearch(next)
{
InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, step1a);
+ function addSearchResultSniffer(step)
+ {
+ function jumpToSearchResult()
+ {
+ step(InspectorTest.currentProfileView()._searchResults.length);
+ }
+ InspectorTest.addSniffer(InspectorTest.currentProfileView(), "_jumpToSearchResult", jumpToSearchResult);
+ }
+
+ function addNodeHighlightSniffer(callback)
+ {
+ InspectorTest.addSniffer(InspectorTest.currentProfileView(), "_didHighlightById", callback);
+ }
function step1a()
{
@@ -39,33 +52,34 @@ function test()
function step2()
{
- InspectorTest.currentProfileView().performSearch("A", step3);
+ addSearchResultSniffer(step3);
+ InspectorTest.currentProfileView().performSearch({query: "A", caseSensitive: false});
}
- function step3(view, resultCount)
+ function step3(resultCount)
{
InspectorTest.assertEquals(1, resultCount, "Search for existing node");
- view.searchCanceled();
- view.performSearch("foo", step4);
+ addSearchResultSniffer(step4);
+ InspectorTest.currentProfileView().performSearch({query: "foo", caseSensitive:false});
}
- function step4(view, resultCount)
+ function step4(resultCount)
{
InspectorTest.assertEquals(0, resultCount, "Search for not-existing node");
- view.searchCanceled();
- view.performSearch("@999", step5);
+ addNodeHighlightSniffer(step5);
+ InspectorTest.currentProfileView().performSearch({query: "@999", caseSensitive: false});
}
- function step5(view, resultCount)
+ function step5(found)
{
- InspectorTest.assertEquals(0, resultCount, "Search for not-existing node by id");
- view.searchCanceled();
- view.performSearch("@83", step6);
+ InspectorTest.assertEquals(false, found, "Search for not-existing node by id");
+ addNodeHighlightSniffer(step6);
+ InspectorTest.currentProfileView().performSearch({query: "@83", caseSensitive:false});
}
- function step6(view, resultCount)
+ function step6(found)
{
- InspectorTest.assertEquals(1, resultCount, "Search for existing node by id");
+ InspectorTest.assertEquals(true, found, "Search for existing node by id");
next();
}
}
« no previous file with comments | « no previous file | LayoutTests/inspector/profiler/heap-snapshot-summary-search-by-id.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698