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

Unified Diff: chrome/test/automation/browser_proxy.cc

Issue 7866026: Added trace query code and wired tracing through BrowserProxy so tests can run traces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 years, 3 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/test/automation/browser_proxy.h ('k') | chrome/test/perf/frame_rate/frame_rate_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automation/browser_proxy.cc
diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc
index a3a1399194c1c8bd66c3324746598f9441943903..9bf31a09026c4d879d81c87b2e51b5f2d201650d 100644
--- a/chrome/test/automation/browser_proxy.cc
+++ b/chrome/test/automation/browser_proxy.cc
@@ -639,3 +639,44 @@ bool BrowserProxy::GetInitialLoadTimes(float* min_start_time,
std::sort(stop_times->begin(), stop_times->end());
return true;
}
+
+bool BrowserProxy::BeginTracing(const std::string& included_categories) {
+ std::vector<std::string> included, excluded;
+ included.push_back(included_categories);
+ return BeginTracing(included, excluded);
+}
+
+bool BrowserProxy::BeginTracing(
+ const std::vector<std::string>& included_categories,
+ const std::vector<std::string>& excluded_categories) {
+ if (!is_valid())
+ return false;
+
+ bool result = false;
+ sender_->Send(new AutomationMsg_BeginTracing(included_categories,
+ excluded_categories,
+ &result));
+ return result;
+}
+
+bool BrowserProxy::EndTracing(std::string* json_trace_output) {
+ if (!is_valid())
+ return false;
+
+ json_trace_output->clear();
+ bool success = false;
+ int remaining_chunks = 0;
+ std::string chunk;
+ sender_->Send(new AutomationMsg_EndTracing(&success));
+ if (success) {
+ // workaround IPC payload size limitation by getting chunks.
+ do {
+ sender_->Send(new AutomationMsg_GetTracingOutput(&chunk,
+ &remaining_chunks));
+ *json_trace_output += chunk;
+ } while (remaining_chunks > 0);
+ success = (remaining_chunks == 0);
+ }
+ return success;
+}
+
« no previous file with comments | « chrome/test/automation/browser_proxy.h ('k') | chrome/test/perf/frame_rate/frame_rate_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698