fix unittest compile error for skia update

Signed-off-by: lushi1202 <lushi@huawei.com>
Change-Id: I83730922dcfa199755a1d16977ea2d74857c9cc0
This commit is contained in:
lushi1202 2023-05-06 22:51:28 +08:00
parent ac87c17843
commit 8a06840fe1
49 changed files with 161 additions and 204 deletions

View File

@ -28,25 +28,18 @@ ohos_unittest("CardFrontendTest") {
"card_frontend_test.cpp",
]
configs = [
":config_domnode_test",
"$ace_root:ace_test_config",
]
configs = [ "$ace_root:ace_test_config" ]
deps = [
"$ace_root/build:ace_ohos_unittest_base",
"$ace_root/frameworks/bridge/js_frontend/engine:js_engine_ark_ohos",
"$ace_root/frameworks/bridge/js_frontend/engine/jsi:js_engine_bridge_ark_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
]
part_name = ace_engine_part
}
config("config_domnode_test") {
visibility = [ ":*" ]
include_dirs = [ "$ace_root" ]
}
group("unittest") {
testonly = true
deps = []

View File

@ -27,10 +27,10 @@ ohos_unittest("PluginFrontendDelegateTest") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_root/build:ace_ohos_unittest_base",
"$ace_root/frameworks/bridge/js_frontend/engine:js_engine_ark_ohos",
"$ace_root/frameworks/bridge/js_frontend/engine/jsi:js_engine_bridge_ark_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
]
part_name = ace_engine_part
@ -47,8 +47,8 @@ ohos_unittest("PluginFrontendTest") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_root/build:ace_ohos_unittest_base",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
]
part_name = ace_engine_part
@ -62,9 +62,10 @@ config("config_domnode_test") {
group("unittest") {
testonly = true
deps = []
deps += [
":PluginFrontendDelegateTest",
":PluginFrontendTest",
]
if (!ace_use_new_skia) {
deps += [
":PluginFrontendDelegateTest",
":PluginFrontendTest",
]
}
}

View File

@ -86,7 +86,7 @@ ohos_unittest("inspector_test_ng") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$cjson_root:cjson",
"//third_party/googletest:gmock_main",

View File

@ -127,10 +127,9 @@ ohos_unittest("view_abstract_test") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ng_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",

View File

@ -135,12 +135,12 @@ ohos_unittest("view_abstract_model_test_ng") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_graphic/rosen/modules/render_service_client:librender_service_client",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ng_ohos",
"$ace_root/frameworks/core/components_ng/render:ace_core_components_render_ng_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",

View File

@ -83,9 +83,8 @@ ohos_unittest("view_partial_update_model_test_ng") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",

View File

@ -126,15 +126,11 @@ ohos_unittest("image_provider_test_ng") {
deps = [
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$cjson_root:cjson_static",
"//third_party/googletest:gmock_main",
]
configs = [ "$ace_root/test/unittest:ace_unittest_config" ]
deps += [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
]
}

View File

@ -75,9 +75,9 @@ ohos_unittest("box_layout_algorithm_test_ng") {
]
deps = [
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_graphic/rosen/modules/render_service_client:librender_service_client",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$cjson_root:cjson",
"//third_party/googletest:gmock_main",

View File

@ -18,8 +18,6 @@ ohos_unittest("drag_drop_manager_test_ng") {
module_out_path = "$manager_test_output_path/drag_drop"
include_dirs = [
"//third_party/flutter/skia",
"//third_party/flutter/skia/src",
"//commonlibrary/c_utils/base/include",
"//foundation/graphic/graphic_2d/rosen/modules/2d_engine",
"//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text",
@ -77,23 +75,17 @@ ohos_unittest("drag_drop_manager_test_ng") {
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
deps = [
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_client:render_service_client_src",
"//third_party/googletest:gmock_main",
]
deps += [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
]
configs = [
"$ace_root:ace_test_config",
"$ace_root:ace_config",
"$ace_flutter_engine_root/skia:skia_config",
"//commonlibrary/c_utils/base:utils_config",
"//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text:rosen_text_config",
]

View File

@ -21,7 +21,6 @@ ohos_unittest("drag_drop_proxy_test_ng") {
module_out_path = "$manager_test_output_path/drag_drop_proxy_test"
include_dirs = [
"//third_party/flutter/skia/src",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/draw",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include",
@ -65,8 +64,8 @@ ohos_unittest("drag_drop_proxy_test_ng") {
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
deps = [
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics",
"//third_party/googletest:gmock_main",
@ -75,7 +74,6 @@ ohos_unittest("drag_drop_proxy_test_ng") {
configs = [
"$ace_root:ace_test_config",
"$ace_root:ace_config",
"$ace_flutter_engine_root/skia:skia_config",
"//commonlibrary/c_utils/base:utils_config",
"//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text:rosen_text_config",
]

View File

@ -21,7 +21,6 @@ ohos_unittest("select_overlay_manager_test_ng") {
module_out_path = "$manager_test_output_path/select_overlay_manager_test"
include_dirs = [
"//third_party/flutter/skia/src",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/draw",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include",
@ -62,8 +61,8 @@ ohos_unittest("select_overlay_manager_test_ng") {
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
deps = [
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics",
"//third_party/googletest:gmock_main",
@ -72,7 +71,6 @@ ohos_unittest("select_overlay_manager_test_ng") {
configs = [
"$ace_root:ace_test_config",
"$ace_root:ace_config",
"$ace_flutter_engine_root/skia:skia_config",
"//commonlibrary/c_utils/base:utils_config",
"//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text:rosen_text_config",
]

View File

@ -21,7 +21,6 @@ ohos_unittest("select_overlay_proxy_test_ng") {
module_out_path = "$manager_test_output_path/select_overlay_proxy_test"
include_dirs = [
"//third_party/flutter/skia/src",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/draw",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include",
@ -62,8 +61,8 @@ ohos_unittest("select_overlay_proxy_test_ng") {
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
deps = [
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics",
"//third_party/googletest:gmock_main",
@ -72,7 +71,6 @@ ohos_unittest("select_overlay_proxy_test_ng") {
configs = [
"$ace_root:ace_test_config",
"$ace_root:ace_config",
"$ace_flutter_engine_root/skia:skia_config",
"//commonlibrary/c_utils/base:utils_config",
"//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text:rosen_text_config",
]

View File

@ -17,8 +17,8 @@ import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
ohos_unittest("ability_component_pattern_test_ng") {
module_out_path = pattern_test_output_path
include_dirs = [
"//third_party/flutter/skia/src",
"//third_party/jsoncpp/include",
"//third_party/bounds_checking_function/include",
"//base/account/os_account/interfaces/innerkits/domain_account/native/include",
@ -34,6 +34,7 @@ ohos_unittest("ability_component_pattern_test_ng") {
"//foundation/ability/ability_runtime/interfaces/inner_api/ability_manager/include",
"//foundation/barrierfree/accessibility/services/aams/test/mock/include",
]
sources = [
# inner
"$ace_root/adapter/ohos/capability/window_connection_ng/window_extension_connection_ohos_ng.cpp",
@ -89,18 +90,19 @@ ohos_unittest("ability_component_pattern_test_ng") {
"ability_component_pattern_test_ng.cpp",
]
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
external_deps += [
external_deps = [
"ability_base:want",
"ability_runtime:ability_manager",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog",
"input:libmmi-client",
"ipc:ipc_core",
"window_manager:libwindow_extension_client",
]
deps = [
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client",
@ -110,10 +112,7 @@ ohos_unittest("ability_component_pattern_test_ng") {
configs = [
"$ace_root:ace_test_config",
"$ace_root:ace_config",
"$ace_flutter_engine_root:flutter_config",
"$ace_flutter_engine_root/skia:skia_config",
"//commonlibrary/c_utils/base:utils_config",
"//foundation/graphic/graphic_2d/utils/buffer_handle:buffer_handle_public_config",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_base:export_config",
@ -124,6 +123,7 @@ ohos_unittest("ability_component_pattern_test_ng") {
"//foundation/window/window_manager/resources/config/build:coverage_flags",
"//foundation/barrierfree/accessibility/frameworks/aafwk/test:module_private_config",
]
defines = [
"ENABLE_ROSEN_BACKEND",
"OS_ACCOUNT_EXISTS",

View File

@ -138,15 +138,11 @@ ohos_unittest("badge_pattern_test_ng") {
deps = [
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$cjson_root:cjson_static",
"//third_party/googletest:gmock_main",
]
configs = [ "$ace_root/test/unittest:ace_unittest_config" ]
deps += [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
]
}

View File

@ -157,9 +157,8 @@ ohos_unittest("container_modal_test_ng") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson_static",

View File

@ -166,10 +166,9 @@ ohos_unittest("custom_dialog_test_ng") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_graphic/rosen/modules/2d_graphics:2d_graphics",
"$ace_graphic/rosen/modules/render_service_client:librender_service_client",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
"//third_party/googletest:gmock_main",
]

View File

@ -29,26 +29,9 @@ ohos_unittest("custom_paint_test_ng") {
deps = [
"$ace_root/build:ace_ohos_unittest_base",
"$ace_root/frameworks/core/components_ng/base:ace_core_components_base_ng_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"//third_party/googletest:gmock_main",
]
configs = [
":config_custom_paint_test",
"$ace_root/test/unittest:ace_unittest_config",
]
}
config("config_custom_paint_test") {
visibility = [ ":*" ]
include_dirs = [
"//commonlibrary/c_utils/base/include",
"$ace_root",
"$ace_root/frameworks",
"$flutter_root/skia",
"$flutter_root/engine",
"$flutter_root/engine/flutter",
"$flutter_root/engine/flutter/third_party/txt/src",
"$flutter_root/skia/third_party/externals/harfbuzz/src",
]
cflags_cc = [ "-w" ]
configs = [ "$ace_root/test/unittest:ace_unittest_config" ]
}

View File

@ -562,6 +562,7 @@ HWTEST_F(CanvasPaintMethodTestNg, CanvasPaintMethodTestNg011, TestSize.Level1)
EXPECT_DOUBLE_EQ(paint2.getAlphaf(), DEFAULT_DOUBLE1);
}
#ifndef NEW_SKIA
/**
* @tc.name: CanvasPaintMethodTestNg012
* @tc.desc: Test the function InitImagePaint of CanvasPaintMethod.
@ -619,6 +620,7 @@ HWTEST_F(CanvasPaintMethodTestNg, CanvasPaintMethodTestNg012, TestSize.Level1)
paintMethod_->InitImagePaint(paintMethod_->imagePaint_);
EXPECT_DOUBLE_EQ(paintMethod_->imagePaint_.getFilterQuality(), SkFilterQuality::kNone_SkFilterQuality);
}
#endif
/**
* @tc.name: CanvasPaintMethodTestNg014

View File

@ -161,6 +161,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg002, TestSize
EXPECT_NE(paint.getPathEffect(), nullptr);
}
#ifndef NEW_SKIA
/**
* @tc.name: CustomPaintPaintMethodTestNg003
* @tc.desc: Test the functions InitImagePaint of CustomPaintPaintMethod.
@ -226,6 +227,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg003, TestSize
paintMethod->InitImagePaint(paintMethod->imagePaint_);
EXPECT_DOUBLE_EQ(paintMethod->imagePaint_.getFilterQuality(), SkFilterQuality::kNone_SkFilterQuality);
}
#endif
/**
* @tc.name: CustomPaintPaintMethodTestNg004
@ -371,7 +373,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg007, TestSize
* @tc.steps2: Test the function DrawSvgImage with flag = DEFAULT_INSTANCE_ID.
* @tc.expected: The value of canvasImage.flag is DEFAULT_INSTANCE_ID.
*/
PaintWrapper* paintWrapper;
PaintWrapper* paintWrapper = nullptr;
Ace::CanvasImage canvasImage;
canvasImage.src = "loading";
canvasImage.flag = DEFAULT_INSTANCE_ID;
@ -416,7 +418,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg008, TestSize
* @tc.steps2: Test the function PutImageData with imageData.data is null.
* @tc.expected: The value of imageData.data is null.
*/
PaintWrapper* paintWrapper;
PaintWrapper* paintWrapper = nullptr;
Ace::ImageData imageData;
imageData.data = {};
paintMethod->PutImageData(paintWrapper, imageData);
@ -475,7 +477,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg010, TestSize
* @tc.steps2: Test the function FillRect with Alpha = DEFAULT_DOUBLE10.
* @tc.expected: The value of HasGlobalAlpha is true.
*/
PaintWrapper* paintWrapper;
PaintWrapper* paintWrapper = nullptr;
Rect rect;
paintMethod->globalState_.SetAlpha(DEFAULT_DOUBLE10);
paintMethod->FillRect(paintWrapper, rect);
@ -490,7 +492,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg010, TestSize
paintMethod->shadow_.SetOffsetY(DEFAULT_DOUBLE1);
paintMethod->FillRect(paintWrapper, rect);
EXPECT_TRUE(paintMethod->HasShadow());
#ifndef NEW_SKIA
/**
* @tc.steps4: Test the function FillRect with SetType.
* @tc.expected: The value of GetType is CompositeOperation::SOURCE_OVER.
@ -506,6 +508,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg010, TestSize
paintMethod->globalState_.SetType(CompositeOperation::SOURCE_IN);
paintMethod->FillRect(paintWrapper, rect);
EXPECT_EQ(static_cast<int>(paintMethod->cachePaint_.getBlendMode()), BLENDMODE_VALUE_END);
#endif
}
/**
@ -528,14 +531,14 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg011, TestSize
* @tc.steps2: Test the function StrokeRect with shadow_.
* @tc.expected: The value of HasShadow is true.
*/
PaintWrapper* paintWrapper;
PaintWrapper* paintWrapper = nullptr;
Rect rect;
paintMethod->shadow_.SetBlurRadius(DEFAULT_DOUBLE1);
paintMethod->shadow_.SetOffsetX(DEFAULT_DOUBLE1);
paintMethod->shadow_.SetOffsetY(DEFAULT_DOUBLE1);
paintMethod->StrokeRect(paintWrapper, rect);
EXPECT_TRUE(paintMethod->HasShadow());
#ifndef NEW_SKIA
/**
* @tc.steps3: Test the function StrokeRect with SetType.
* @tc.expected: The value of GetType is CompositeOperation::SOURCE_OVER.
@ -551,6 +554,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg011, TestSize
paintMethod->globalState_.SetType(CompositeOperation::SOURCE_IN);
paintMethod->StrokeRect(paintWrapper, rect);
EXPECT_EQ(static_cast<int>(paintMethod->cachePaint_.getBlendMode()), BLENDMODE_VALUE_END);
#endif
}
/**
@ -574,7 +578,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg012, TestSize
* @tc.expected: The value of HasGlobalAlpha is true.
*/
PaintWrapper* paintWrapper;
PaintWrapper* paintWrapper = nullptr;
paintMethod->globalState_.SetAlpha(DEFAULT_DOUBLE10);
paintMethod->Fill(paintWrapper);
@ -589,7 +593,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg012, TestSize
paintMethod->shadow_.SetOffsetY(DEFAULT_DOUBLE1);
paintMethod->Fill(paintWrapper);
EXPECT_TRUE(paintMethod->HasShadow());
#ifndef NEW_SKIA
/**
* @tc.steps4: Test the function Fill with SetType.
* @tc.expected: The value of GetType is CompositeOperation::SOURCE_OVER.
@ -605,6 +609,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg012, TestSize
paintMethod->globalState_.SetType(CompositeOperation::SOURCE_IN);
paintMethod->Fill(paintWrapper);
EXPECT_EQ(static_cast<int>(paintMethod->cachePaint_.getBlendMode()), BLENDMODE_VALUE_END);
#endif
}
/**
@ -642,7 +647,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg013, TestSize
paintMethod->shadow_.SetOffsetY(DEFAULT_DOUBLE1);
paintMethod->Path2DFill(offset);
EXPECT_TRUE(paintMethod->HasShadow());
#ifndef NEW_SKIA
/**
* @tc.steps4: Test the function Path2DFill with SetType.
* @tc.expected: The value of GetType is CompositeOperation::SOURCE_OVER.
@ -658,6 +663,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg013, TestSize
paintMethod->globalState_.SetType(CompositeOperation::SOURCE_IN);
paintMethod->Path2DFill(offset);
EXPECT_EQ(static_cast<int>(paintMethod->cachePaint_.getBlendMode()), BLENDMODE_VALUE_END);
#endif
}
/**
@ -680,13 +686,13 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg014, TestSize
* @tc.steps2: Test the function Stroke with shadow_.
* @tc.expected: The value of HasShadow is true.
*/
PaintWrapper* paintWrapper;
PaintWrapper* paintWrapper = nullptr;
paintMethod->shadow_.SetBlurRadius(DEFAULT_DOUBLE1);
paintMethod->shadow_.SetOffsetX(DEFAULT_DOUBLE1);
paintMethod->shadow_.SetOffsetY(DEFAULT_DOUBLE1);
paintMethod->Stroke(paintWrapper);
EXPECT_TRUE(paintMethod->HasShadow());
#ifndef NEW_SKIA
/**
* @tc.steps3: Test the function Stroke with SetType.
* @tc.expected: The value of GetType is CompositeOperation::SOURCE_OVER.
@ -702,6 +708,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg014, TestSize
paintMethod->globalState_.SetType(CompositeOperation::SOURCE_IN);
paintMethod->Stroke(paintWrapper);
EXPECT_EQ(static_cast<int>(paintMethod->cachePaint_.getBlendMode()), BLENDMODE_VALUE_END);
#endif
}
/**
@ -730,7 +737,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg015, TestSize
paintMethod->shadow_.SetOffsetY(DEFAULT_DOUBLE1);
paintMethod->Path2DStroke(offset);
EXPECT_TRUE(paintMethod->HasShadow());
#ifndef NEW_SKIA
/**
* @tc.steps3: Test the function Path2DStroke with SetType.
* @tc.expected: The value of GetType is CompositeOperation::SOURCE_OVER.
@ -746,6 +753,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg015, TestSize
paintMethod->globalState_.SetType(CompositeOperation::SOURCE_IN);
paintMethod->Path2DStroke(offset);
EXPECT_EQ(static_cast<int>(paintMethod->cachePaint_.getBlendMode()), BLENDMODE_VALUE_END);
#endif
}
/**
@ -768,7 +776,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg016, TestSize
* @tc.steps2: Test the function Arc with angle.
* @tc.expected: The value of angle is true.
*/
PaintWrapper* paintWrapper;
PaintWrapper* paintWrapper = nullptr;
ArcParam param;
param.startAngle = 1.5 * M_PI; // start angle of the circle
param.endAngle = 3.5 * M_PI;
@ -918,7 +926,7 @@ HWTEST_F(CustomPaintPaintMethodTestNg, CustomPaintPaintMethodTestNg018, TestSize
* @tc.steps2: Test the function Ellipse with angle.
* @tc.expected: The value of angle is true.
*/
PaintWrapper* paintWrapper;
PaintWrapper* paintWrapper = nullptr;
EllipseParam param;
param.startAngle = 1.5 * M_PI; // start angle of the Ellipse
param.endAngle = 3.5 * M_PI;

View File

@ -775,7 +775,7 @@ HWTEST_F(CustomPaintPatternTestNg, CustomPaintPatternTestNg016, TestSize.Level1)
* @tc.steps2: Test functions about CanvasFillRule.
* @tc.expected: The task queue of paintMethod is changed to unempty.
*/
CanvasFillRule rule;
CanvasFillRule rule = CanvasFillRule::NONZERO;
customPattern->UpdateFillRuleForPath(rule);
EXPECT_TRUE(paintMethod->HasTask());

View File

@ -46,6 +46,9 @@ public:
size_t end,
RectHeightStyle rect_height_style,
RectWidthStyle rect_width_style));
#ifdef NEW_SKIA
MOCK_METHOD0(GetLineMetrics, std::vector<txt::LineMetrics>&());
#endif
};
} // namespace OHOS::Ace::NG

View File

@ -25,14 +25,10 @@ ohos_unittest("dragBar_pattern_test_ng") {
deps = [
"$ace_root/build:ace_ohos_unittest_base",
"$ace_root/frameworks/core/components_ng/base:ace_core_components_base_ng_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"//third_party/googletest:gmock_main",
]
deps += [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
]
configs = [
":config_dragBar_test",
"$ace_root:ace_config",

View File

@ -119,6 +119,8 @@ ohos_unittest("form_pattern_test_ng") {
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/test/unittest:ace_unittest_log",
"$cjson_root:cjson_static",
"//foundation/graphic/graphic_2d:libsurface",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client",
"//third_party/googletest:gmock_main",
]
@ -126,10 +128,7 @@ ohos_unittest("form_pattern_test_ng") {
"//drivers/peripheral/display/interfaces/include",
"//foundation/graphic/graphic_2d/interfaces/innerkits/surface",
]
deps += [
"//foundation/graphic/graphic_2d:libsurface",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client",
]
if (is_ohos_standard_system) {
external_deps = [
"ability_base:want",
@ -143,10 +142,9 @@ ohos_unittest("form_pattern_test_ng") {
"ipc:ipc_core",
]
}
configs = [ "$ace_root/test/unittest:ace_unittest_config" ]
configs += [
"$ace_root/../../graphic/graphic_2d/rosen/modules/render_service_base:export_config",
"$ace_root/../../graphic/graphic_2d/rosen/modules/render_service_client:render_service_client_config",
"$ace_flutter_engine_root/skia:skia_config",
configs = [
"$ace_root/test/unittest:ace_unittest_config",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_base:export_config",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_client:render_service_client_config",
]
}

View File

@ -21,7 +21,6 @@ ohos_unittest("image_animator_pattern_test") {
module_out_path = pattern_test_output_path
include_dirs = [
"//third_party/flutter/skia",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/draw",
@ -77,8 +76,8 @@ ohos_unittest("image_animator_pattern_test") {
]
deps = [
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",
@ -89,10 +88,7 @@ ohos_unittest("image_animator_pattern_test") {
configs = [
"$ace_root/test/unittest:ace_unittest_config",
"$ace_root:ace_config",
"$ace_flutter_engine_root:flutter_config",
"$ace_flutter_engine_root/skia:skia_config",
"//commonlibrary/c_utils/base:utils_config",
"//foundation/graphic/graphic_2d/utils/buffer_handle:buffer_handle_public_config",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_base:export_config",

View File

@ -178,10 +178,9 @@ ohos_unittest("navigation_test_ng") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",

View File

@ -21,7 +21,6 @@ ohos_unittest("panel_option_test_ng") {
module_out_path = pattern_test_output_path
include_dirs = [
"//third_party/flutter/skia/src",
"//third_party/bounds_checking_function/include",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include",
@ -118,9 +117,8 @@ ohos_unittest("panel_option_test_ng") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",
@ -132,8 +130,6 @@ ohos_unittest("panel_option_test_ng") {
configs = [
"$ace_root:ace_test_config",
"$ace_root:ace_config",
"$ace_flutter_engine_root:flutter_config",
"$ace_flutter_engine_root/skia:skia_config",
"//commonlibrary/c_utils/base:utils_config",
"//foundation/graphic/graphic_2d/utils/buffer_handle:buffer_handle_public_config",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_base:export_config",

View File

@ -190,10 +190,9 @@ ohos_unittest("picker_test_ng") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",

View File

@ -117,20 +117,18 @@ ohos_unittest("plugin_pattern_test_ng") {
]
deps = [
"$ability_runtime_inner_api_path/ability_manager:ability_manager",
"$ability_runtime_services_path/abilitymgr:abilityms",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/interfaces/inner_api/ui_service_manager:ui_service_mgr",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$cjson_root:cjson_static",
"//third_party/googletest:gmock_main",
]
deps += [
"$ability_runtime_inner_api_path/ability_manager:ability_manager",
"$ability_runtime_services_path/abilitymgr:abilityms",
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_root/interfaces/inner_api/ui_service_manager:ui_service_mgr",
"//third_party/zlib:shared_libz",
]
external_deps = [
"ability_base:extractortool",
"ability_base:want",
@ -141,11 +139,11 @@ ohos_unittest("plugin_pattern_test_ng") {
"safwk:system_ability_fwk",
"samgr:samgr_proxy",
]
configs = [ "$ace_root/test/unittest:ace_unittest_config" ]
configs += [
"$ace_root/../../graphic/graphic_2d/rosen/modules/render_service_base:export_config",
"$ace_root/../../graphic/graphic_2d/rosen/modules/render_service_client:render_service_client_config",
"$ace_flutter_engine_root/skia:skia_config",
configs = [
"$ace_root/test/unittest:ace_unittest_config",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_base:export_config",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_client:render_service_client_config",
]
if (os_account_exists) {

View File

@ -30,13 +30,6 @@ ohos_unittest("refresh_pattern_test_ng") {
"//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text",
"//foundation/arkui/ace_engine/frameworks/base/memory",
"//third_party/bounds_checking_function/include",
"//third_party/flutter/engine",
"//third_party/flutter/engine/flutter/third_party/txt/src/txt",
"//third_party/flutter/engine/flutter/third_party/txt/src",
"//third_party/flutter/engine/flutter/third_party/txt/src/minikin",
"//third_party/flutter/skia/third_party",
"//third_party/flutter/skia/third_party/externals/icu/source/common",
"//third_party/flutter/skia/third_party/externals/harfbuzz/src",
"//foundation/arkui/ace_engine/frameworks",
"//base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter",
"//foundation/arkui/ace_engine/frameworks/base/window",
@ -183,6 +176,7 @@ ohos_unittest("refresh_pattern_test_ng") {
deps = [
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",

View File

@ -192,8 +192,7 @@ ohos_unittest("select_overlay_test_ng") {
]
deps += [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"//third_party/icu/icu4c:shared_icui18n",
"//third_party/icu/icu4c:shared_icuuc",
]

View File

@ -144,17 +144,13 @@ ohos_unittest("swiper_pattern_test_ng") {
deps = [
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",
"//third_party/googletest:gmock_main",
]
deps += [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
]
if (platform == "ohos") {
deps += [
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics",

View File

@ -148,9 +148,8 @@ ohos_unittest("text_test_ng") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",

View File

@ -72,21 +72,16 @@ ohos_unittest("text_clock_pattern_test_ng") {
deps = [
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_client:render_service_client_src",
"//third_party/googletest:gmock_main",
]
deps += [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
]
configs = [
":config_text_clock_test",
"$ace_root:ace_config",
"$ace_root:ace_test_config",
]
@ -97,7 +92,6 @@ ohos_unittest("text_clock_pattern_test_ng") {
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src/drawing/engine_adapter",
"//third_party/flutter/skia",
]
}

View File

@ -204,8 +204,7 @@ ohos_unittest("textfield_test_ng") {
]
deps += [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"//third_party/icu/icu4c:shared_icui18n",
"//third_party/icu/icu4c:shared_icuuc",
]

View File

@ -72,21 +72,16 @@ ohos_unittest("text_timer_pattern_test_ng") {
deps = [
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_client:render_service_client_src",
"//third_party/googletest:gmock_main",
]
deps += [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
]
configs = [
":config_text_timer_test",
"$ace_root:ace_config",
"$ace_root:ace_test_config",
]
@ -97,7 +92,6 @@ ohos_unittest("text_timer_pattern_test_ng") {
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src",
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src/drawing/engine_adapter",
"//third_party/flutter/skia",
]
}

View File

@ -30,13 +30,6 @@ ohos_unittest("video_pattern_test_ng") {
"//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text",
"//foundation/arkui/ace_engine/frameworks/base/memory",
"//third_party/bounds_checking_function/include",
"//third_party/flutter/engine",
"//third_party/flutter/engine/flutter/third_party/txt/src/txt",
"//third_party/flutter/engine/flutter/third_party/txt/src",
"//third_party/flutter/engine/flutter/third_party/txt/src/minikin",
"//third_party/flutter/skia/third_party",
"//third_party/flutter/skia/third_party/externals/harfbuzz/src",
"//third_party/flutter/skia/third_party/externals/icu/source/common",
"//foundation/arkui/ace_engine/frameworks",
"//base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter",
"//foundation/arkui/ace_engine/frameworks/base/window",
@ -202,6 +195,7 @@ ohos_unittest("video_pattern_test_ng") {
deps = [
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",

View File

@ -123,10 +123,9 @@ ohos_unittest("grid_property_test_ng") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ng_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",

View File

@ -25,9 +25,8 @@ ohos_fuzztest("AceResKeyParserFuzzTest") {
"//foundation/arkui/ace_engine/test/fuzztest/acereskeyparser_fuzzer"
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
]
sources = [

View File

@ -31,10 +31,9 @@ ohos_fuzztest("ImageApiFuzzTest") {
"-fno-omit-frame-pointer",
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base/resource:ace_resource",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
# "//third_party/googletest:gtest_main",

View File

@ -31,10 +31,9 @@ ohos_fuzztest("ImageLoaderFuzzTest") {
"-fno-omit-frame-pointer",
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base/resource:ace_resource",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
# "//third_party/googletest:gtest_main",

View File

@ -25,9 +25,8 @@ ohos_fuzztest("ManifestFuzzTest") {
"//foundation/arkui/ace_engine/test/fuzztest/manifest_fuzzer"
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
# "//third_party/googletest:gtest_main",

View File

@ -24,9 +24,8 @@ ohos_fuzztest("Res2FuzzTest") {
fuzz_config_file = "//foundation/arkui/ace_engine/test/fuzztest/res2_fuzzer"
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
# "//third_party/googletest:gtest_main",

View File

@ -24,9 +24,8 @@ ohos_fuzztest("SharedImageManagerFuzzTest") {
fuzz_config_file =
"//foundation/arkui/ace_engine/test/fuzztest/sharedimagemanager_fuzzer"
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$cjson_root:cjson",
]
sources = [

View File

@ -0,0 +1,26 @@
/*
* Copyright (c) 2022 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 "flutter/lib/ui/window/window.h"
#include "flutter/runtime/window_manager.h"
namespace flutter {
Window* WindowManager::GetWindow(int32_t instance_id)
{
return nullptr;
}
void Window::ScheduleFrame() {}
} // namespace flutter

View File

@ -302,3 +302,24 @@ ohos_source_set("ace_core_animation") {
configs = [ ":ace_unittest_config" ]
}
ohos_source_set("ace_engine_unittest_flutter_deps") {
sources = []
public_configs = []
public_deps = []
if (ace_use_new_skia) {
sources += [ "$ace_root/test/mock/core/common/mock_flutter_window.cpp" ]
public_deps += [
"$ace_flutter_engine_root/libtxt:thirdparty_lib_txt_ohos",
"$skia_root_new:skia_ohos",
]
cflags_cc = [ "-Wno-thread-safety-attributes" ]
external_deps = [ "eventhandler:libeventhandler" ]
public_configs += [ "$ace_flutter_engine_root:flutter_config" ]
} else {
public_deps += [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
]
}
}

View File

@ -39,6 +39,7 @@ template("ace_unittest") {
ace_unittest_name = target_name
ace_unittest_config = [ "$ace_root/test/unittest:ace_unittest_config" ]
flutter_sources = []
flutter_external_deps = []
ace_unittest_deps = [
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/test/unittest:ace_unittest_log",
@ -69,18 +70,15 @@ template("ace_unittest") {
if (flutter_skia) {
if (ace_use_new_skia) {
flutter_sources += [
"$flutter_root/engine/flutter/runtime/window_manager.cc",
"$flutter_root/engine/flutter/shell/platform/ohos/platform_task_runner.cc",
"$flutter_root/engine/flutter/shell/platform/ohos/platform_task_runner_adapter.cc",
]
flutter_sources +=
[ "$ace_root/test/mock/core/common/mock_flutter_window.cpp" ]
ace_unittest_deps += [
"$ace_flutter_engine_root:flutter_engine_common_ohos",
"$ace_flutter_engine_root:flutter_engine_fml_ohos",
"$ace_flutter_engine_root/libtxt:thirdparty_lib_txt_ohos",
"$skia_root_new:skia_ohos",
]
ace_unittest_config += [ "$ace_flutter_engine_root:flutter_config" ]
flutter_external_deps = [ "eventhandler:libeventhandler" ]
} else {
ace_unittest_deps += [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
@ -140,9 +138,8 @@ template("ace_unittest") {
if (defined(invoker.configs)) {
configs += invoker.configs
}
external_deps = flutter_external_deps
if (defined(invoker.external_deps)) {
external_deps = []
external_deps += invoker.external_deps
}
}
@ -159,7 +156,7 @@ template("ace_unittest") {
if (defined(invoker.configs)) {
configs += invoker.configs
}
external_deps = flutter_external_deps
if (defined(invoker.external_deps)) {
external_deps = []
external_deps += invoker.external_deps

View File

@ -30,10 +30,17 @@ ohos_unittest("flutter_test") {
configs = [ "$ace_root/test/unittest:ace_unittest_config" ]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/adapter/ohos/osal:ace_osal_ohos",
"$ace_root/frameworks/base:ace_base_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"//third_party/googletest:gmock_main",
]
if (ace_use_new_skia) {
sources += [
"$flutter_root/engine/flutter/shell/platform/ohos/platform_task_runner.cc",
"$flutter_root/engine/flutter/shell/platform/ohos/platform_task_runner_adapter.cc",
]
deps += [ "$ace_flutter_engine_root:flutter_engine_common_ohos" ]
}
}

View File

@ -30,10 +30,9 @@ ohos_unittest("rosen_test") {
configs = [ "$ace_root/test/unittest:ace_unittest_config" ]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/adapter/ohos/osal:ace_osal_ohos",
"$ace_root/frameworks/base:ace_base_ohos",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"//third_party/googletest:gmock_main",
]
}

View File

@ -264,11 +264,10 @@ ohos_unittest("pipeline_context_test_ng") {
]
deps = [
"$ace_flutter_engine_root:third_party_flutter_engine_ohos",
"$ace_flutter_engine_root/skia:ace_skia_ohos",
"$ace_root/frameworks/base:ace_memory_monitor_ohos",
"$ace_root/frameworks/core/components/theme:ace_core_components_theme_ohos",
"$ace_root/frameworks/core/components/theme:build_theme_code",
"$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
"$ace_root/test/unittest:ace_unittest_log",
"$ace_root/test/unittest:ace_unittest_trace",
"$cjson_root:cjson",