|
| 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