5#include <initializer_list>
7#include "flutter/common/settings.h"
8#include "flutter/fml/command_line.h"
9#include "flutter/shell/common/switches.h"
11#include "gtest/gtest.h"
19TEST(SwitchesTest, SkiaTraceAllowlistFlag) {
26 EXPECT_EQ(
settings.trace_skia_allowlist->size(), 1ul);
36 EXPECT_FALSE(
settings.trace_skia_allowlist.has_value());
42 {
"command",
"--trace-skia-allowlist=aaa,bbb,ccc"});
47 EXPECT_EQ(
settings.trace_skia_allowlist->size(), 3ul);
48 EXPECT_EQ(
settings.trace_skia_allowlist->back(),
"ccc");
54TEST(SwitchesTest, TraceToFile) {
56 {
"command",
"--trace-to-file=trace.binpb"});
59 EXPECT_EQ(
settings.trace_to_file,
"trace.binpb");
62TEST(SwitchesTest, RouteParsedFlag) {
66 EXPECT_EQ(
settings.route,
"/animation");
72TEST(SwitchesTest, EnableEmbedderAPI) {
76 {
"command",
"--enable-embedder-api"});
78 EXPECT_EQ(
settings.enable_embedder_api,
true);
85 EXPECT_EQ(
settings.enable_embedder_api,
false);
89TEST(SwitchesTest, NoEnableImpeller) {
96 EXPECT_EQ(
settings.enable_impeller,
true);
101 {
"command",
"--enable-impeller=false"});
104 EXPECT_EQ(
settings.enable_impeller,
false);
109TEST(SwitchesTest, EnableAsserts) {
111 {
"command",
"--dart-flags=--enable-asserts"});
113 ASSERT_EQ(
settings.dart_flags.size(), 1ul);
114 EXPECT_EQ(
settings.dart_flags[0],
"--enable-asserts");
bool HasOption(std::string_view name, size_t *index=nullptr) const
TEST(DisplayListComplexity, EmptyDisplayList)
Settings SettingsFromCommandLine(const fml::CommandLine &command_line)
CommandLine CommandLineFromInitializerList(std::initializer_list< StringType > argv)
#define EXPECT_TRUE(handle)