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

Unified Diff: chrome/test/base/tracing.h

Issue 10837082: implement SetWatchEvent and WaitForEvent for trace-based-tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update / merge -- no change Created 8 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 | « chrome/chrome_tests.gypi ('k') | chrome/test/base/tracing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/tracing.h
diff --git a/chrome/test/base/tracing.h b/chrome/test/base/tracing.h
index 4ba107ed4a603823a93ddceb966de6f12c3c680e..15dffc7bf65ef1d82537a0eec1a3165a34575541 100644
--- a/chrome/test/base/tracing.h
+++ b/chrome/test/base/tracing.h
@@ -8,13 +8,15 @@
#include <string>
#include "base/compiler_specific.h"
+#include "base/time.h"
namespace tracing {
+// Called from UI thread.
// Begin tracing specified categories on the browser.
-// |categories| is a comma-delimited list of category wildcards.
-// A category can have an optional '-' prefix to make it an excluded category.
-// Either all categories must be included or all must be excluded.
+// |categories| is a comma-delimited list of category wildcards. A category can
+// have an optional '-' prefix to make it an excluded category. Either all
+// categories must be included or all must be excluded.
//
// Example: BeginTracing("test_MyTest*");
// Example: BeginTracing("test_MyTest*,test_OtherStuff");
@@ -24,6 +26,22 @@ namespace tracing {
// categories.
bool BeginTracing(const std::string& categories) WARN_UNUSED_RESULT;
+// Called from UI thread.
+// Specify a watch event in order to use the WaitForWatchEvent function.
+// After |num_occurrences| of the given event have been seen on a particular
+// process, WaitForWatchEvent will return.
+bool BeginTracingWithWatch(const std::string& categories,
+ const std::string& category_name,
+ const std::string& event_name,
+ int num_occurrences) WARN_UNUSED_RESULT;
+
+// Called from UI thread.
+// Wait on the event set with BeginTracingWithWatch. If non-zero, return after
+// |timeout| regardless of watch event notification. Returns true if watch event
+// occurred, false if it timed out.
+bool WaitForWatchEvent(base::TimeDelta timeout) WARN_UNUSED_RESULT;
+
+// Called from UI thread.
// End trace and collect the trace output as a json string.
bool EndTracing(std::string* json_trace_output) WARN_UNUSED_RESULT;
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/base/tracing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698