Skip to content

Commit d7f3b66

Browse files
bbrto21swift-kim
authored andcommitted
Add FlutterProjectBundle unit tests (#156)
* Taken from the Windows implementation Signed-off-by: Boram Bae <[email protected]>
1 parent 4b82605 commit d7f3b66

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

shell/platform/tizen/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ executable("flutter_tizen_unittests") {
268268
testonly = true
269269

270270
sources = [
271+
"flutter_project_bundle_unittests.cc",
271272
"flutter_tizen_engine_unittest.cc",
272273
"flutter_tizen_texture_registrar_unittests.cc",
273274
"testing/mock_engine.cc",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright 2021 Samsung Electronics Co., Ltd. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#include "flutter/shell/platform/tizen/flutter_project_bundle.h"
6+
#include "gtest/gtest.h"
7+
8+
namespace flutter {
9+
namespace testing {
10+
11+
TEST(FlutterProjectBundle, BasicPropertiesAbsolutePaths) {
12+
FlutterDesktopEngineProperties properties = {};
13+
properties.assets_path = "/foo/flutter_assets";
14+
properties.icu_data_path = "/foo/icudtl.dat";
15+
16+
FlutterProjectBundle project(properties);
17+
18+
EXPECT_TRUE(project.HasValidPaths());
19+
EXPECT_EQ(project.assets_path().string(), "/foo/flutter_assets");
20+
EXPECT_EQ(project.icu_path().string(), "/foo/icudtl.dat");
21+
}
22+
23+
TEST(FlutterProjectBundle, BasicPropertiesRelativePaths) {
24+
FlutterDesktopEngineProperties properties = {};
25+
properties.assets_path = "foo/flutter_assets";
26+
properties.icu_data_path = "foo/icudtl.dat";
27+
28+
FlutterProjectBundle project(properties);
29+
30+
EXPECT_TRUE(project.HasValidPaths());
31+
EXPECT_TRUE(project.assets_path().is_absolute());
32+
EXPECT_EQ(project.assets_path().filename().string(), "flutter_assets");
33+
EXPECT_TRUE(project.icu_path().is_absolute());
34+
EXPECT_EQ(project.icu_path().filename().string(), "icudtl.dat");
35+
}
36+
37+
} // namespace testing
38+
} // namespace flutter

0 commit comments

Comments
 (0)