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

Unified Diff: trace_event/trace_config_unittest.cc

Issue 2045223003: Update to Chromium //base at Chromium commit 82baa9afc6620c68cb2168f20bb65e77e3e57f0a. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 years, 6 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 | « trace_event/trace_config_memory_test_util.h ('k') | trace_event/trace_event_etw_export_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trace_event/trace_config_unittest.cc
diff --git a/trace_event/trace_config_unittest.cc b/trace_event/trace_config_unittest.cc
index 7d8881da3e1338c4a9d438df4edc4b4da2df9b23..96225957c7631a0a879957559ec5ce539c6cd742 100644
--- a/trace_event/trace_config_unittest.cc
+++ b/trace_event/trace_config_unittest.cc
@@ -1,9 +1,10 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/trace_config.h"
+#include "base/trace_event/trace_config_memory_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
@@ -20,44 +21,6 @@ const char kDefaultTraceConfigString[] =
"\"record_mode\":\"record-until-full\""
"}";
-const char kMemoryDumpTraceConfigString[] =
- "{"
- "\"enable_argument_filter\":false,"
- "\"enable_sampling\":false,"
- "\"enable_systrace\":false,"
- "\"included_categories\":["
- "\"disabled-by-default-memory-infra\""
- "],"
- "\"memory_dump_config\":{"
- "\"triggers\":["
- "{"
- "\"mode\":\"light\","
- "\"periodic_interval_ms\":200"
- "},"
- "{"
- "\"mode\":\"detailed\","
- "\"periodic_interval_ms\":2000"
- "}"
- "]"
- "},"
- "\"record_mode\":\"record-until-full\""
- "}";
-
-const char kTraceConfigStringWithEmptyTriggers[] =
- "{"
- "\"enable_argument_filter\":false,"
- "\"enable_sampling\":false,"
- "\"enable_systrace\":false,"
- "\"included_categories\":["
- "\"disabled-by-default-memory-infra\""
- "],"
- "\"memory_dump_config\":{"
- "\"triggers\":["
- "]"
- "},"
- "\"record_mode\":\"record-until-full\""
- "}";
-
} // namespace
TEST(TraceConfigTest, TraceConfigFromValidLegacyFormat) {
@@ -528,24 +491,27 @@ TEST(TraceConfigTest, SetTraceOptionValues) {
}
TEST(TraceConfigTest, TraceConfigFromMemoryConfigString) {
- TraceConfig tc(kMemoryDumpTraceConfigString);
- EXPECT_STREQ(kMemoryDumpTraceConfigString, tc.ToString().c_str());
+ std::string tc_str =
+ TraceConfigMemoryTestUtil::GetTraceConfig_PeriodicTriggers(200, 2000);
+ TraceConfig tc(tc_str);
+ EXPECT_EQ(tc_str, tc.ToString());
EXPECT_TRUE(tc.IsCategoryGroupEnabled(MemoryDumpManager::kTraceCategory));
EXPECT_EQ(2u, tc.memory_dump_config_.size());
EXPECT_EQ(200u, tc.memory_dump_config_[0].periodic_interval_ms);
- EXPECT_EQ(MemoryDumpArgs::LevelOfDetail::LOW,
+ EXPECT_EQ(MemoryDumpLevelOfDetail::LIGHT,
tc.memory_dump_config_[0].level_of_detail);
EXPECT_EQ(2000u, tc.memory_dump_config_[1].periodic_interval_ms);
- EXPECT_EQ(MemoryDumpArgs::LevelOfDetail::HIGH,
+ EXPECT_EQ(MemoryDumpLevelOfDetail::DETAILED,
tc.memory_dump_config_[1].level_of_detail);
}
TEST(TraceConfigTest, EmptyMemoryDumpConfigTest) {
// Empty trigger list should also be specified when converting back to string.
- TraceConfig tc(kTraceConfigStringWithEmptyTriggers);
- EXPECT_STREQ(kTraceConfigStringWithEmptyTriggers, tc.ToString().c_str());
+ TraceConfig tc(TraceConfigMemoryTestUtil::GetTraceConfig_EmptyTriggers());
+ EXPECT_EQ(TraceConfigMemoryTestUtil::GetTraceConfig_EmptyTriggers(),
+ tc.ToString());
EXPECT_EQ(0u, tc.memory_dump_config_.size());
}
« no previous file with comments | « trace_event/trace_config_memory_test_util.h ('k') | trace_event/trace_event_etw_export_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698