#include "services/tracing/public/cpp/trace_startup_config.h"
#include <algorithm>
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/memory/ptr_util.h"
#include "base/ranges/algorithm.h"
#include "components/tracing/common/tracing_switches.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/perfetto/include/perfetto/tracing/core/trace_config.h"
#include "third_party/perfetto/protos/perfetto/config/data_source_config.gen.h"
namespace tracing {
namespace {
const char kTraceConfig[] = …;
std::string GetTraceConfigFileContent(std::string trace_config,
std::string startup_duration,
std::string result_file) { … }
}
class TraceStartupConfigTest : public ::testing::Test { … };
TEST_F(TraceStartupConfigTest, TraceStartupEnabled) { … }
TEST_F(TraceStartupConfigTest, TraceStartupConfigNotEnabled) { … }
TEST_F(TraceStartupConfigTest, TraceStartupConfigEnabledWithoutPath) { … }
TEST_F(TraceStartupConfigTest, TraceStartupConfigEnabledWithInvalidPath) { … }
TEST_F(TraceStartupConfigTest, ValidContent) { … }
TEST_F(TraceStartupConfigTest, ValidContentWithOnlyTraceConfig) { … }
TEST_F(TraceStartupConfigTest, ContentWithAbsoluteResultFilePath) { … }
TEST_F(TraceStartupConfigTest, ContentWithNegtiveDuration) { … }
TEST_F(TraceStartupConfigTest, ContentWithoutTraceConfig) { … }
TEST_F(TraceStartupConfigTest, InvalidContent) { … }
TEST_F(TraceStartupConfigTest, EmptyContent) { … }
TEST_F(TraceStartupConfigTest, TraceStartupDisabledSystemOwner) { … }
TEST_F(TraceStartupConfigTest, TraceStartupEnabledSystemOwner) { … }
}