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

Unified Diff: content/browser/tracing/tracing_controller_browsertest.cc

Issue 139313005: Implement TracingController::GetMonitoringStatus (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « no previous file | content/browser/tracing/tracing_controller_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tracing/tracing_controller_browsertest.cc
diff --git a/content/browser/tracing/tracing_controller_browsertest.cc b/content/browser/tracing/tracing_controller_browsertest.cc
index bccf90af44a27ec6c27afb5b718be72d44d0724c..84494863fe144d7bc80915e6d40665257e6e0678 100644
--- a/content/browser/tracing/tracing_controller_browsertest.cc
+++ b/content/browser/tracing/tracing_controller_browsertest.cc
@@ -148,19 +148,47 @@ class TracingControllerTest : public ContentBrowserTest {
TracingController* controller = TracingController::GetInstance();
{
+ bool is_monitoring;
+ std::string category_filter;
+ TracingController::Options options;
+ controller->GetMonitoringStatus(&is_monitoring,
+ &category_filter,
+ &options);
+ EXPECT_FALSE(is_monitoring);
+ EXPECT_EQ("-*Debug,-*Test", category_filter);
+ EXPECT_FALSE(options & TracingController::ENABLE_SYSTRACE);
+ EXPECT_FALSE(options & TracingController::RECORD_CONTINUOUSLY);
+ EXPECT_FALSE(options & TracingController::ENABLE_SAMPLING);
+ }
+
+ {
base::RunLoop run_loop;
TracingController::EnableMonitoringDoneCallback callback =
base::Bind(&TracingControllerTest::EnableMonitoringDoneCallbackTest,
base::Unretained(this),
run_loop.QuitClosure());
bool result = controller->EnableMonitoring(
- "", TracingController::ENABLE_SAMPLING, callback);
+ "*", TracingController::ENABLE_SAMPLING, callback);
ASSERT_TRUE(result);
run_loop.Run();
EXPECT_EQ(enable_monitoring_done_callback_count(), 1);
}
{
+ bool is_monitoring;
+ std::string category_filter;
+ TracingController::Options options;
+ controller->GetMonitoringStatus(&is_monitoring,
+ &category_filter,
+ &options);
+ EXPECT_TRUE(is_monitoring);
+ EXPECT_EQ("*", category_filter);
+ EXPECT_FALSE(options & TracingController::ENABLE_SYSTRACE);
+ EXPECT_FALSE(options & TracingController::RECORD_CONTINUOUSLY);
+ EXPECT_TRUE(options & TracingController::ENABLE_SAMPLING);
+ }
+
+ {
base::RunLoop run_loop;
TracingController::TracingFileResultCallback callback =
base::Bind(&TracingControllerTest::
@@ -184,6 +212,20 @@ class TracingControllerTest : public ContentBrowserTest {
run_loop.Run();
EXPECT_EQ(disable_monitoring_done_callback_count(), 1);
}
+
+ {
+ bool is_monitoring;
+ std::string category_filter;
+ TracingController::Options options;
+ controller->GetMonitoringStatus(&is_monitoring,
+ &category_filter,
+ &options);
+ EXPECT_FALSE(is_monitoring);
+ EXPECT_EQ("", category_filter);
+ EXPECT_FALSE(options & TracingController::ENABLE_SYSTRACE);
+ EXPECT_FALSE(options & TracingController::RECORD_CONTINUOUSLY);
+ EXPECT_FALSE(options & TracingController::ENABLE_SAMPLING);
+ }
}
private:
@@ -257,7 +299,7 @@ IN_PROC_BROWSER_TEST_F(
TracingController* controller = TracingController::GetInstance();
EXPECT_TRUE(controller->EnableMonitoring(
- "", TracingController::ENABLE_SAMPLING,
+ "*", TracingController::ENABLE_SAMPLING,
TracingController::EnableMonitoringDoneCallback()));
controller->CaptureMonitoringSnapshot(
base::FilePath(), TracingController::TracingFileResultCallback());
« no previous file with comments | « no previous file | content/browser/tracing/tracing_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698