Skip to content

Commit 80fcd81

Browse files
bbrto21swift-kim
authored andcommitted
Add FlutterProjectBundle.Switches unit tests (#159)
* Unlike the Windows implementation, environment variables are not used. Signed-off-by: Boram Bae <[email protected]>
1 parent 19f0456 commit 80fcd81

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

shell/platform/tizen/flutter_project_bundle_unittests.cc

+33
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,38 @@ TEST(FlutterProjectBundle, BasicPropertiesRelativePaths) {
3434
EXPECT_EQ(project.icu_path().filename().string(), "icudtl.dat");
3535
}
3636

37+
TEST(FlutterProjectBundle, SwitchesEmpty) {
38+
FlutterDesktopEngineProperties properties = {};
39+
properties.assets_path = "foo/flutter_assets";
40+
properties.icu_data_path = "foo/icudtl.dat";
41+
42+
std::vector<const char*> switches;
43+
properties.switches = switches.data();
44+
properties.switches_count = switches.size();
45+
46+
FlutterProjectBundle project(properties);
47+
48+
EXPECT_EQ(project.switches().size(), 0u);
49+
}
50+
51+
TEST(FlutterProjectBundle, Switches) {
52+
FlutterDesktopEngineProperties properties = {};
53+
properties.assets_path = "foo/flutter_assets";
54+
properties.icu_data_path = "foo/icudtl.dat";
55+
56+
std::vector<const char*> switches;
57+
switches.push_back("--abc");
58+
switches.push_back("--foo=\"bar, baz\"");
59+
60+
properties.switches = switches.data();
61+
properties.switches_count = switches.size();
62+
63+
FlutterProjectBundle project(properties);
64+
65+
EXPECT_EQ(project.switches().size(), 2u);
66+
EXPECT_EQ(project.switches()[0], "--abc");
67+
EXPECT_EQ(project.switches()[1], "--foo=\"bar, baz\"");
68+
}
69+
3770
} // namespace testing
3871
} // namespace flutter

0 commit comments

Comments
 (0)