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

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: cleaned up and fixed a bug 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
Index: chrome/test/base/tracing.h
diff --git a/chrome/test/base/tracing.h b/chrome/test/base/tracing.h
index 4ba107ed4a603823a93ddceb966de6f12c3c680e..5f432a1c51022e955e3620b1b72d03481930b5ef 100644
--- a/chrome/test/base/tracing.h
+++ b/chrome/test/base/tracing.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/compiler_specific.h"
+#include "base/time.h"
namespace tracing {
@@ -24,6 +25,19 @@ namespace tracing {
// categories.
bool BeginTracing(const std::string& categories) WARN_UNUSED_RESULT;
+// 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 char* category_name,
+ const char* event_name,
+ int num_occurrences) WARN_UNUSED_RESULT;
+
+// 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;
+
// End trace and collect the trace output as a json string.
bool EndTracing(std::string* json_trace_output) WARN_UNUSED_RESULT;

Powered by Google App Engine
This is Rietveld 408576698