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

Unified Diff: base/debug/trace_event_unittest.cc

Issue 440903003: Add RECORD_AS_MUCH_AS_POSSIBLE mode to TraceOptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert telemetry change Created 6 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 | « base/debug/trace_event_impl_constants.cc ('k') | content/browser/devtools/devtools_tracing_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_unittest.cc
diff --git a/base/debug/trace_event_unittest.cc b/base/debug/trace_event_unittest.cc
index 566a65e6bc7a18cdc6dd9c49966adc1577fed640..821bf343e466ad4595246f01bfca594c08f9a247 100644
--- a/base/debug/trace_event_unittest.cc
+++ b/base/debug/trace_event_unittest.cc
@@ -2608,6 +2608,15 @@ TEST_F(TraceEventTestFixture, TraceBufferRingBufferFullIteration) {
TraceLog::GetInstance()->SetDisabled();
}
+TEST_F(TraceEventTestFixture, TraceRecordAsMuchAsPossibleMode) {
+ TraceLog::GetInstance()->SetEnabled(CategoryFilter("*"),
+ TraceLog::RECORDING_MODE,
+ TraceOptions(RECORD_AS_MUCH_AS_POSSIBLE));
+ TraceBuffer* buffer = TraceLog::GetInstance()->trace_buffer();
+ EXPECT_EQ(512000000UL, buffer->Capacity());
+ TraceLog::GetInstance()->SetDisabled();
+}
+
// Test the category filter.
TEST_F(TraceEventTestFixture, CategoryFilter) {
// Using the default filter.
@@ -3011,6 +3020,11 @@ TEST(TraceOptionsTest, DISABLED_TraceOptionsFromString) {
EXPECT_FALSE(options.enable_sampling);
EXPECT_FALSE(options.enable_systrace);
+ options = TraceOptions("record-as-much-as-possible");
+ EXPECT_EQ(RECORD_AS_MUCH_AS_POSSIBLE, options.record_mode);
+ EXPECT_FALSE(options.enable_sampling);
+ EXPECT_FALSE(options.enable_systrace);
+
options = TraceOptions("record-until-full, enable-sampling");
EXPECT_EQ(RECORD_UNTIL_FULL, options.record_mode);
EXPECT_TRUE(options.enable_sampling);
@@ -3045,12 +3059,14 @@ TEST(TraceOptionsTest, DISABLED_TraceOptionsFromString) {
TEST(TraceOptionsTest, TraceOptionsToString) {
// Test that we can intialize TraceOptions from a string got from
// TraceOptions.ToString() method to get a same TraceOptions.
- TraceRecordMode modes[] = {
- RECORD_UNTIL_FULL, RECORD_CONTINUOUSLY, ECHO_TO_CONSOLE};
+ TraceRecordMode modes[] = {RECORD_UNTIL_FULL,
+ RECORD_CONTINUOUSLY,
+ ECHO_TO_CONSOLE,
+ RECORD_AS_MUCH_AS_POSSIBLE};
bool enable_sampling_options[] = {true, false};
bool enable_systrace_options[] = {true, false};
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 2; ++j) {
for (int k = 0; k < 2; ++k) {
TraceOptions original_option = TraceOptions(modes[i]);
« no previous file with comments | « base/debug/trace_event_impl_constants.cc ('k') | content/browser/devtools/devtools_tracing_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698