diff --git a/BUILD.gn b/BUILD.gn index 7a102d594bf570c401e4a55e5682fd014a56ab81..66d7f4ee309563f57b44666715e24c00e26ce1ca 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -152,6 +152,7 @@ group("unittests") { "//flutter/runtime:no_dart_plugin_registrant_unittests", "//flutter/runtime:runtime_unittests", "//flutter/shell/common:shell_unittests", + "//flutter/shell/platform/ohos:flutter_ohos_unittests", "//flutter/shell/platform/embedder:embedder_a11y_unittests", "//flutter/shell/platform/embedder:embedder_proctable_unittests", "//flutter/shell/platform/embedder:embedder_unittests", diff --git a/shell/platform/ohos/BUILD.gn b/shell/platform/ohos/BUILD.gn index c8e36f5796a88e0230a7095e12d56d603d38c046..3b1b9c21c22bf75c09ee0f33409db179cc4db42f 100644 --- a/shell/platform/ohos/BUILD.gn +++ b/shell/platform/ohos/BUILD.gn @@ -176,6 +176,7 @@ executable("flutter_ohos_unittests") { sources = [ #"testing/mock_texture_registrar.cc", + "testing/ohos_assert_provider_test.cc" ] public_configs = [ "//flutter:config" ] @@ -197,6 +198,15 @@ executable("flutter_ohos_unittests") { "//flutter/shell/platform/embedder:embedder_test_utils", "//flutter/testing", ] + + ldflags = ["-lace_ndk.z"] + ldflags += ["-lnative_window"] + ldflags += ["-lnative_vsync"] + ldflags += ["-limage_ndk.z"] + ldflags += ["-lrawfile.z"] + ldflags += ["-lnative_image"] + ldflags += ["-lpixelmap_ndk.z"] + ldflags += ["-lqos"] } shared_library("flutter_shell_native") { diff --git a/shell/platform/ohos/testing/ohos_assert_provider_test.cc b/shell/platform/ohos/testing/ohos_assert_provider_test.cc new file mode 100644 index 0000000000000000000000000000000000000000..2a67bc5a1cc4f7626a824773a17cc1b5193f926b --- /dev/null +++ b/shell/platform/ohos/testing/ohos_assert_provider_test.cc @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include + +#include "gtest/gtest.h" +#include "gmock/gmock.h" + +#include "../ohos_asset_provider.h" + +TEST(OHOSAssetProviderTest, Build001) { + std::shared_ptr provider = std::make_shared(nullptr); + EXPECT_EQ(provider, nullptr); +}