| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "components/tracing/browser/trace_config_file.h" | 9 #include "components/tracing/browser/trace_config_file.h" |
| 10 #include "components/tracing/common/tracing_switches.h" | 10 #include "components/tracing/common/tracing_switches.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace tracing { | 13 namespace tracing { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 const char kTraceConfig[] = | 17 const char kTraceConfig[] = |
| 18 "{" | 18 "{" |
| 19 "\"enable_argument_filter\":true," | 19 "\"enable_argument_filter\":true," |
| 20 "\"enable_sampling\":true," | |
| 21 "\"enable_systrace\":true," | 20 "\"enable_systrace\":true," |
| 22 "\"excluded_categories\":[\"excluded\",\"exc_pattern*\"]," | 21 "\"excluded_categories\":[\"excluded\",\"exc_pattern*\"]," |
| 23 "\"included_categories\":[\"included\"," | 22 "\"included_categories\":[\"included\"," |
| 24 "\"inc_pattern*\"," | 23 "\"inc_pattern*\"," |
| 25 "\"disabled-by-default-cc\"]," | 24 "\"disabled-by-default-cc\"]," |
| 26 "\"record_mode\":\"record-continuously\"," | 25 "\"record_mode\":\"record-continuously\"," |
| 27 "\"synthetic_delays\":[\"test.Delay1;16\",\"test.Delay2;32\"]" | 26 "\"synthetic_delays\":[\"test.Delay1;16\",\"test.Delay2;32\"]" |
| 28 "}"; | 27 "}"; |
| 29 | 28 |
| 30 std::string GetTraceConfigFileContent(std::string trace_config, | 29 std::string GetTraceConfigFileContent(std::string trace_config, |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 241 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
| 243 ASSERT_TRUE( | 242 ASSERT_TRUE( |
| 244 base::CreateTemporaryFileInDir(temp_dir.GetPath(), &trace_config_file)); | 243 base::CreateTemporaryFileInDir(temp_dir.GetPath(), &trace_config_file)); |
| 245 base::CommandLine::ForCurrentProcess()->AppendSwitchPath( | 244 base::CommandLine::ForCurrentProcess()->AppendSwitchPath( |
| 246 switches::kTraceConfigFile, trace_config_file); | 245 switches::kTraceConfigFile, trace_config_file); |
| 247 | 246 |
| 248 EXPECT_FALSE(TraceConfigFile::GetInstance()->IsEnabled()); | 247 EXPECT_FALSE(TraceConfigFile::GetInstance()->IsEnabled()); |
| 249 } | 248 } |
| 250 | 249 |
| 251 } // namespace tracing | 250 } // namespace tracing |
| OLD | NEW |