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

Side by Side Diff: base/trace_event/trace_config_unittest.cc

Issue 2047533002: [tracing] Add browser test for background memory tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@set_whitelist
Patch Set: Fixes. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/trace_event/memory_dump_manager.h" 9 #include "base/trace_event/memory_dump_manager.h"
10 #include "base/trace_event/trace_config.h" 10 #include "base/trace_event/trace_config.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 tc1.memory_dump_config_.triggers[0].level_of_detail); 580 tc1.memory_dump_config_.triggers[0].level_of_detail);
581 581
582 EXPECT_EQ(2000u, tc1.memory_dump_config_.triggers[1].periodic_interval_ms); 582 EXPECT_EQ(2000u, tc1.memory_dump_config_.triggers[1].periodic_interval_ms);
583 EXPECT_EQ(MemoryDumpLevelOfDetail::DETAILED, 583 EXPECT_EQ(MemoryDumpLevelOfDetail::DETAILED,
584 tc1.memory_dump_config_.triggers[1].level_of_detail); 584 tc1.memory_dump_config_.triggers[1].level_of_detail);
585 EXPECT_EQ( 585 EXPECT_EQ(
586 2048u, 586 2048u,
587 tc1.memory_dump_config_.heap_profiler_options.breakdown_threshold_bytes); 587 tc1.memory_dump_config_.heap_profiler_options.breakdown_threshold_bytes);
588 588
589 std::string tc_str2 = 589 std::string tc_str2 =
590 TraceConfigMemoryTestUtil::GetTraceConfig_BackgroundTrigger(); 590 TraceConfigMemoryTestUtil::GetTraceConfig_BackgroundTrigger(
591 1 /* period_ms */);
591 TraceConfig tc2(tc_str2); 592 TraceConfig tc2(tc_str2);
592 EXPECT_EQ(tc_str2, tc2.ToString()); 593 EXPECT_EQ(tc_str2, tc2.ToString());
593 EXPECT_TRUE(tc2.IsCategoryGroupEnabled(MemoryDumpManager::kTraceCategory)); 594 EXPECT_TRUE(tc2.IsCategoryGroupEnabled(MemoryDumpManager::kTraceCategory));
594 ASSERT_EQ(1u, tc2.memory_dump_config_.triggers.size()); 595 ASSERT_EQ(1u, tc2.memory_dump_config_.triggers.size());
595 EXPECT_EQ(1u, tc2.memory_dump_config_.triggers[0].periodic_interval_ms); 596 EXPECT_EQ(1u, tc2.memory_dump_config_.triggers[0].periodic_interval_ms);
596 EXPECT_EQ(MemoryDumpLevelOfDetail::BACKGROUND, 597 EXPECT_EQ(MemoryDumpLevelOfDetail::BACKGROUND,
597 tc2.memory_dump_config_.triggers[0].level_of_detail); 598 tc2.memory_dump_config_.triggers[0].level_of_detail);
598 } 599 }
599 600
600 TEST(TraceConfigTest, EmptyMemoryDumpConfigTest) { 601 TEST(TraceConfigTest, EmptyMemoryDumpConfigTest) {
(...skipping 14 matching lines...) Expand all
615 EXPECT_NE(std::string::npos, tc.ToString().find("memory_dump_config")); 616 EXPECT_NE(std::string::npos, tc.ToString().find("memory_dump_config"));
616 EXPECT_EQ(2u, tc.memory_dump_config_.triggers.size()); 617 EXPECT_EQ(2u, tc.memory_dump_config_.triggers.size());
617 EXPECT_EQ(TraceConfig::MemoryDumpConfig::HeapProfiler 618 EXPECT_EQ(TraceConfig::MemoryDumpConfig::HeapProfiler
618 ::kDefaultBreakdownThresholdBytes, 619 ::kDefaultBreakdownThresholdBytes,
619 tc.memory_dump_config_.heap_profiler_options 620 tc.memory_dump_config_.heap_profiler_options
620 .breakdown_threshold_bytes); 621 .breakdown_threshold_bytes);
621 } 622 }
622 623
623 } // namespace trace_event 624 } // namespace trace_event
624 } // namespace base 625 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698