fixed mock file

Signed-off-by: liyujie <liyujie43@huawei.com>
Change-Id: I3bd4d89fc539529a7f72f2128f8239fa36444f79
This commit is contained in:
liyujie 2022-12-05 14:41:19 +08:00
parent 5c0501398c
commit 0fc299669c
37 changed files with 145 additions and 145 deletions

View File

@ -92,17 +92,17 @@ foreach(item, ace_platforms) {
testonly = true
sources = [
"$ace_root/frameworks/base/test/mock/mock_ace_container.cpp",
"$ace_root/frameworks/base/test/mock/mock_download_manager.cpp",
"$ace_root/frameworks/base/test/mock/mock_drag_window_old.cpp",
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
"$ace_root/frameworks/core/components/test/unittest/mock/subwindow_mock.cpp",
"$ace_root/frameworks/core/mock/mock_download_manager.cpp",
"$ace_root/frameworks/core/mock/mock_resource_adapter.cpp",
]
if (is_standard_system) {
sources -= [
"$ace_root/frameworks/core/mock/mock_download_manager.cpp",
"$ace_root/frameworks/core/mock/mock_resource_adapter.cpp",
"$ace_root/frameworks/base/test/mock/mock_download_manager.cpp",
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
]
}

View File

@ -19,9 +19,9 @@
#include "base/resource/asset_manager.h"
namespace OHOS::Ace {
class FakeAsset final : public Asset {
class MockAsset final : public Asset {
public:
~FakeAsset() override = default;
~MockAsset() override = default;
size_t GetSize() const override
{
@ -34,9 +34,9 @@ public:
}
};
class FakeAssetManager final : public AssetManager {
class MockAssetManager final : public AssetManager {
public:
~FakeAssetManager() override = default;
~MockAssetManager() override = default;
void PushFront(RefPtr<AssetProvider> provider) override {}

View File

@ -20,7 +20,7 @@
#include "base/thread/task_executor.h"
namespace OHOS::Ace {
class FakeTaskExecutor final : public TaskExecutor {
class MockTaskExecutor final : public TaskExecutor {
public:
bool WillRunOnCurrentThread(TaskType type) const final
{

View File

@ -25,7 +25,7 @@ ohos_unittest("SubwindowManagerTest") {
sources = [
"//foundation/arkui/ace_engine/frameworks/base/test/mock/mock_subwindow_ohos.cpp",
"//foundation/arkui/ace_engine/frameworks/core/mock/mock_container.cpp",
"//foundation/arkui/ace_engine/frameworks/core/common/test/mock/mock_container.cpp",
"subwindow_manager_test.cpp",
]

View File

@ -50,7 +50,7 @@ void CardFrontendDeclarativeTest::TearDown() {}
HWTEST_F(CardFrontendDeclarativeTest, Initialize001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontendDeclarative>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -66,7 +66,7 @@ HWTEST_F(CardFrontendDeclarativeTest, Initialize001, TestSize.Level1)
HWTEST_F(CardFrontendDeclarativeTest, GetPageRouterManager001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontendDeclarative>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -84,7 +84,7 @@ HWTEST_F(CardFrontendDeclarativeTest, GetPageRouterManager001, TestSize.Level1)
HWTEST_F(CardFrontendDeclarativeTest, Destroy001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontendDeclarative>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -103,7 +103,7 @@ HWTEST_F(CardFrontendDeclarativeTest, Destroy001, TestSize.Level1)
HWTEST_F(CardFrontendDeclarativeTest, AttachPipelineContext001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontendDeclarative>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -124,13 +124,13 @@ HWTEST_F(CardFrontendDeclarativeTest, AttachPipelineContext001, TestSize.Level1)
HWTEST_F(CardFrontendDeclarativeTest, SetAssetManager001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontendDeclarative>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
ASSERT_NE(cardFrontend->manifestParser_, nullptr);
ASSERT_EQ(cardFrontend->type_, FrontendType::JS_CARD);
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
cardFrontend->SetAssetManager(assetManager);
ASSERT_NE(cardFrontend->assetManager_, nullptr);
}
@ -143,7 +143,7 @@ HWTEST_F(CardFrontendDeclarativeTest, SetAssetManager001, TestSize.Level1)
HWTEST_F(CardFrontendDeclarativeTest, RunPage001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontendDeclarative>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -167,7 +167,7 @@ HWTEST_F(CardFrontendDeclarativeTest, RunPage001, TestSize.Level1)
HWTEST_F(CardFrontendDeclarativeTest, UpdateData001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontendDeclarative>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -189,7 +189,7 @@ HWTEST_F(CardFrontendDeclarativeTest, UpdateData001, TestSize.Level1)
HWTEST_F(CardFrontendDeclarativeTest, UpdatePageData001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontendDeclarative>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -212,7 +212,7 @@ HWTEST_F(CardFrontendDeclarativeTest, UpdatePageData001, TestSize.Level1)
HWTEST_F(CardFrontendDeclarativeTest, SetColorMode001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontendDeclarative>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -230,7 +230,7 @@ HWTEST_F(CardFrontendDeclarativeTest, SetColorMode001, TestSize.Level1)
HWTEST_F(CardFrontendDeclarativeTest, OnSurfaceChanged001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontendDeclarative>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -253,7 +253,7 @@ HWTEST_F(CardFrontendDeclarativeTest, OnSurfaceChanged001, TestSize.Level1)
HWTEST_F(CardFrontendDeclarativeTest, HandleSurfaceChanged001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontendDeclarative>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -276,7 +276,7 @@ HWTEST_F(CardFrontendDeclarativeTest, HandleSurfaceChanged001, TestSize.Level1)
HWTEST_F(CardFrontendDeclarativeTest, OnMediaFeatureUpdate001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontendDeclarative>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);

View File

@ -2630,7 +2630,7 @@ HWTEST_F(CardFrontendTest, JsCardParserGetClockConfig005, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendInitialize001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2646,7 +2646,7 @@ HWTEST_F(CardFrontendTest, CardFrontendInitialize001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendDestroy001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2666,7 +2666,7 @@ HWTEST_F(CardFrontendTest, CardFrontendDestroy001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendAttachPipelineContext001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2687,13 +2687,13 @@ HWTEST_F(CardFrontendTest, CardFrontendAttachPipelineContext001, TestSize.Level1
HWTEST_F(CardFrontendTest, CardFrontendSetAssetManager001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
ASSERT_NE(cardFrontend->manifestParser_, nullptr);
ASSERT_EQ(cardFrontend->type_, FrontendType::JS_CARD);
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
cardFrontend->SetAssetManager(assetManager);
ASSERT_NE(cardFrontend->assetManager_, nullptr);
}
@ -2706,7 +2706,7 @@ HWTEST_F(CardFrontendTest, CardFrontendSetAssetManager001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendParseManifest001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2727,7 +2727,7 @@ HWTEST_F(CardFrontendTest, CardFrontendParseManifest001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendRunPage001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2751,7 +2751,7 @@ HWTEST_F(CardFrontendTest, CardFrontendRunPage001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendGetFormSrcPath001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2775,7 +2775,7 @@ HWTEST_F(CardFrontendTest, CardFrontendGetFormSrcPath001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendGetPage001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2793,7 +2793,7 @@ HWTEST_F(CardFrontendTest, CardFrontendGetPage001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendGetWindowConfig001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2814,7 +2814,7 @@ HWTEST_F(CardFrontendTest, CardFrontendGetWindowConfig001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendLoadPage001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2838,7 +2838,7 @@ HWTEST_F(CardFrontendTest, CardFrontendLoadPage001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendParsePage001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2867,7 +2867,7 @@ HWTEST_F(CardFrontendTest, CardFrontendParsePage001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendUpdateData001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2889,7 +2889,7 @@ HWTEST_F(CardFrontendTest, CardFrontendUpdateData001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendUpdatePageData001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2912,7 +2912,7 @@ HWTEST_F(CardFrontendTest, CardFrontendUpdatePageData001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendSetColorMode001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2930,7 +2930,7 @@ HWTEST_F(CardFrontendTest, CardFrontendSetColorMode001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendRebuildAllPages001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2951,7 +2951,7 @@ HWTEST_F(CardFrontendTest, CardFrontendRebuildAllPages001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendOnSurfaceChanged001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2974,7 +2974,7 @@ HWTEST_F(CardFrontendTest, CardFrontendOnSurfaceChanged001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendHandleSurfaceChanged001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);
@ -2997,7 +2997,7 @@ HWTEST_F(CardFrontendTest, CardFrontendHandleSurfaceChanged001, TestSize.Level1)
HWTEST_F(CardFrontendTest, CardFrontendOnMediaFeatureUpdate001, TestSize.Level1)
{
auto cardFrontend = AceType::MakeRefPtr<CardFrontend>();
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
cardFrontend->Initialize(FrontendType::JS_CARD, taskExecutor);
ASSERT_NE(cardFrontend->taskExecutor_, nullptr);
ASSERT_NE(cardFrontend->delegate_, nullptr);

View File

@ -51,7 +51,7 @@ RefPtr<PipelineContext> PluginFrontendDelegateTest::GetPipelineContext(const Ref
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FlutterTaskExecutor>();
taskExecutor->InitJsThread(false);
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
return AceType::MakeRefPtr<PipelineContext>(
std::move(window), taskExecutor, assetManager, resRegister, frontend, 0);

View File

@ -56,7 +56,7 @@ RefPtr<PipelineContext> PluginFrontendTest::GetPipelineContext(const RefPtr<Plug
auto taskExecutor = Referenced::MakeRefPtr<FlutterTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
return AceType::MakeRefPtr<PipelineContext>(
std::move(window), taskExecutor, assetManager, resRegister, frontend, 0);

View File

@ -21,9 +21,9 @@
#include "core/image/image_loader.h"
namespace OHOS::Ace {
void AnimationMock::OnPostFlush()
void MockAnimation::OnPostFlush()
{
LOGD("AnimationMock PostFlush start");
LOGD("MockAnimation PostFlush start");
postFlushCallTimes_++;
CreateInterpolators();
AddListeners();
@ -31,10 +31,10 @@ void AnimationMock::OnPostFlush()
setRepeatSucc_ = animator_->SetIteration(iteration_);
animator_->SetStartDelay(startDelay_);
ExecuteOperation();
LOGD("AnimationMock PostFlush end");
LOGD("MockAnimation PostFlush end");
}
void AnimationMock::ExecuteOperation()
void MockAnimation::ExecuteOperation()
{
switch (operation_) {
case AnimationOperation::PLAY:
@ -58,20 +58,20 @@ void AnimationMock::ExecuteOperation()
}
}
void AnimationMock::AddListeners()
void MockAnimation::AddListeners()
{
auto weak = AceType::WeakClaim(this);
animator_->AddStartListener([weak]() {
auto simulator = weak.Upgrade();
if (simulator) {
LOGD("AnimationMock vsync triggered. start listener called.");
LOGD("MockAnimation vsync triggered. start listener called.");
simulator->animationStartStatus_ = true;
}
});
animator_->AddStopListener([weak]() {
auto simulator = weak.Upgrade();
if (simulator) {
LOGD("AnimationMock vsync triggered. stop listener called.");
LOGD("MockAnimation vsync triggered. stop listener called.");
simulator->animationStopStatus_ = true;
simulator->animationIntStopValue_ = simulator->animationIntValue_;
}
@ -79,34 +79,34 @@ void AnimationMock::AddListeners()
animator_->AddRepeatListener([weak]() {
auto simulator = weak.Upgrade();
if (simulator) {
LOGD("AnimationMock vsync triggered. repeat listener called.");
LOGD("MockAnimation vsync triggered. repeat listener called.");
++(simulator->repeatDoneTimes_);
}
});
animator_->AddIdleListener([weak]() {
auto simulator = weak.Upgrade();
if (simulator) {
LOGD("AnimationMock vsync triggered. idle listener called.");
LOGD("MockAnimation vsync triggered. idle listener called.");
simulator->animationIdleStatus_ = true;
}
});
animator_->AddPauseListener([weak]() {
auto simulator = weak.Upgrade();
if (simulator) {
LOGD("AnimationMock vsync triggered. resume listener called.");
LOGD("MockAnimation vsync triggered. resume listener called.");
simulator->animationPauseStatus_ = true;
}
});
}
void AnimationMock::CreatePictureInterpolators()
void MockAnimation::CreatePictureInterpolators()
{
auto weak = AceType::WeakClaim(this);
if (pictureInt_) {
pictureInt_->AddListener([weak](const int& value) {
auto simulator = weak.Upgrade();
if (simulator) {
LOGD("AnimationMock vsync triggered. pictureIntValue_ int value: %{public}d", value);
LOGD("MockAnimation vsync triggered. pictureIntValue_ int value: %{public}d", value);
simulator->pictureIntValue_ = value;
}
});
@ -116,7 +116,7 @@ void AnimationMock::CreatePictureInterpolators()
pictureString_->AddListener([weak](const std::string& value) {
auto simulator = weak.Upgrade();
if (simulator) {
LOGD("AnimationMock vsync triggered. pictureStringValue_ int value: %{public}s", value.data());
LOGD("MockAnimation vsync triggered. pictureStringValue_ int value: %{public}s", value.data());
simulator->pictureStringValue_ = value;
}
});
@ -124,40 +124,40 @@ void AnimationMock::CreatePictureInterpolators()
}
}
void AnimationMock::CreateInterpolators()
void MockAnimation::CreateInterpolators()
{
auto weak = AceType::WeakClaim(this);
if (animationInt_) {
animationInt_->AddListener([weak](const int& value) {
auto simulator = weak.Upgrade();
if (simulator) {
LOGD("AnimationMock vsync triggered. int value: %{public}d", value);
LOGD("MockAnimation vsync triggered. int value: %{public}d", value);
simulator->animationIntValue_ = value;
}
});
LOGD("AnimationMock PostFlush. animationInt_ has been added.");
LOGD("MockAnimation PostFlush. animationInt_ has been added.");
animator_->AddInterpolator(animationInt_);
}
if (animationFloat_) {
animationFloat_->AddListener([weak](const float& value) {
auto simulator = weak.Upgrade();
if (simulator) {
LOGD("AnimationMock vsync triggered. float value: %{public}f", value);
LOGD("MockAnimation vsync triggered. float value: %{public}f", value);
simulator->animationFloatValue_ = value;
}
});
LOGD("AnimationMock PostFlush. animationFloat_ has been add.");
LOGD("MockAnimation PostFlush. animationFloat_ has been add.");
animator_->AddInterpolator(animationFloat_);
}
if (keyframeAnimation_) {
keyframeAnimation_->AddListener([weak](const float& value) {
auto simulator = weak.Upgrade();
if (simulator) {
LOGD("AnimationMock vsync triggered. keyframeAnimation_ float value: %{public}f", value);
LOGD("MockAnimation vsync triggered. keyframeAnimation_ float value: %{public}f", value);
simulator->keyframeAnimationValue_ = value;
}
});
LOGD("AnimationMock PostFlush. keyframeAnimation_ has been added.");
LOGD("MockAnimation PostFlush. keyframeAnimation_ has been added.");
animator_->AddInterpolator(keyframeAnimation_);
}
if (animationColor_) {
@ -172,17 +172,17 @@ void AnimationMock::CreateInterpolators()
CreatePictureInterpolators();
}
const RefPtr<Animator>& AnimationMock::GetAnimator() const
const RefPtr<Animator>& MockAnimation::GetAnimator() const
{
return animator_;
}
double AnimationMock::GetPositionResult() const
double MockAnimation::GetPositionResult() const
{
return positionResult_;
}
void AnimationMock::SetPositionResult(double positionResult)
void MockAnimation::SetPositionResult(double positionResult)
{
positionResult_ = positionResult;
}

View File

@ -25,12 +25,12 @@
#include "core/components/common/properties/tween_option.h"
namespace OHOS::Ace {
class AnimationMock : public FlushEvent {
DECLARE_ACE_TYPE(AnimationMock, FlushEvent);
class MockAnimation : public FlushEvent {
DECLARE_ACE_TYPE(MockAnimation, FlushEvent);
public:
AnimationMock() = default;
~AnimationMock() override = default;
MockAnimation() = default;
~MockAnimation() override = default;
void OnPostFlush() override;

View File

@ -88,15 +88,15 @@ public:
std::unique_ptr<PlatformWindow> platformWindow = AnimationTestUtils::CreatePlatformWindow();
platformWindowRaw_ = reinterpret_cast<MockPlatformWindow*>(platformWindow.get());
auto window = AnimationTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = AceType::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = AceType::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
RefPtr<Frontend> frontend = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(
std::move(window), taskExecutor, assetManager, resRegister, frontend, 0);
context_->SetTimeProvider(
[this] { return this->platformWindowRaw_->GetCurrentTimestampNano() + NANOSECOND_TO_MILLISECOND * 10; });
flushEventMock_ = AceType::MakeRefPtr<AnimationMock>();
flushEventMock_ = AceType::MakeRefPtr<MockAnimation>();
context_->SetupRootElement();
context_->OnSurfaceChanged(100, 200);
@ -373,7 +373,7 @@ public:
protected:
RefPtr<PipelineContext> context_;
RefPtr<AnimationMock> flushEventMock_;
RefPtr<MockAnimation> flushEventMock_;
MockPlatformWindow* platformWindowRaw_ = nullptr;
};

View File

@ -88,8 +88,8 @@ public:
std::unique_ptr<PlatformWindow> platformWindow = AnimationTestUtils::CreatePlatformWindow();
platformWindowRaw_ = reinterpret_cast<MockPlatformWindow*>(platformWindow.get());
auto window = AnimationTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = AceType::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = AceType::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
RefPtr<Frontend> frontend = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(

View File

@ -142,8 +142,8 @@ public:
std::unique_ptr<PlatformWindow> platformWindow = AnimationTestUtils::CreatePlatformWindow();
platformWindowRaw_ = reinterpret_cast<MockPlatformWindow*>(platformWindow.get());
auto window = AnimationTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = AceType::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = AceType::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
RefPtr<Frontend> frontend = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(

View File

@ -153,8 +153,8 @@ public:
{
auto platformWindow = PlatformWindow::Create(nullptr);
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
frontend_ = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(

View File

@ -78,8 +78,8 @@ RefPtr<PipelineContext> DisplayTestUtils::GetMockContext()
{
auto platformWindow = std::make_unique<MockWindow>(nullptr);
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = Frontend::CreateDefault();
return AceType::MakeRefPtr<PipelineContext>(

View File

@ -118,8 +118,8 @@ RefPtr<PipelineContext> GetMockContext()
{
auto platformWindow = PlatformWindow::Create(nullptr);
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = Frontend::CreateDefault();
return AceType::MakeRefPtr<PipelineContext>(

View File

@ -113,8 +113,8 @@ public:
std::unique_ptr<PlatformWindow> platformWindow = TweenTestUtils::CreatePlatformWindow();
platformWindowRaw_ = reinterpret_cast<MockPlatformWindow*>(platformWindow.get());
auto window = TweenTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = AceType::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = AceType::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
RefPtr<Frontend> frontend = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(

View File

@ -44,8 +44,8 @@ RefPtr<PipelineContext> MockRenderCommon::GetMockContext()
{
auto platformWindow = PlatformWindow::Create(nullptr);
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = Frontend::CreateDefault();

View File

@ -223,8 +223,8 @@ RefPtr<PipelineContext> RenderTestUtils::GetMockPipelineContext(const RefPtr<Fro
{
auto platformWindow = PlatformWindow::Create(nullptr);
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
return AceType::MakeRefPtr<PipelineContext>(
std::move(window), taskExecutor, assetManager, resRegister, frontend, 0);

View File

@ -45,7 +45,7 @@ RefPtr<PipelineContext> PluginCallBackClientTest::GetPipelineContext(const RefPt
auto platformWindow = PlatformWindow::Create(nullptr);
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FlutterTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
return AceType::MakeRefPtr<PipelineContext>(
std::move(window), taskExecutor, assetManager, resRegister, frontend, 0);

View File

@ -50,7 +50,7 @@ RefPtr<PipelineContext> PluginComponentTest::GetPipelineContext(const RefPtr<Plu
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FlutterTaskExecutor>();
taskExecutor->InitJsThread(false);
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
return AceType::MakeRefPtr<PipelineContext>(
std::move(window), taskExecutor, assetManager, resRegister, frontend, 0);

View File

@ -45,7 +45,7 @@ RefPtr<PipelineContext> PluginElementTest::GetPipelineContext(const RefPtr<Plugi
auto taskExecutor = Referenced::MakeRefPtr<FlutterTaskExecutor>();
taskExecutor->InitPlatformThread();
taskExecutor->InitJsThread(true);
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
return AceType::MakeRefPtr<PipelineContext>(
std::move(window), taskExecutor, assetManager, resRegister, frontend, 0);

View File

@ -44,7 +44,7 @@ RefPtr<PipelineContext> PluginManagerDelegateTest::GetPipelineContext(const RefP
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FlutterTaskExecutor>();
taskExecutor->InitJsThread(false);
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
return AceType::MakeRefPtr<PipelineContext>(
std::move(window), taskExecutor, assetManager, resRegister, frontend, 0);

View File

@ -44,7 +44,7 @@ RefPtr<PipelineContext> PluginManagerResourceTest::GetPipelineContext(const RefP
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FlutterTaskExecutor>();
taskExecutor->InitJsThread(false);
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
return AceType::MakeRefPtr<PipelineContext>(
std::move(window), taskExecutor, assetManager, resRegister, frontend, 0);

View File

@ -54,7 +54,7 @@ RefPtr<PipelineContext> PluginSubContainerTest::GetPipelineContext(const RefPtr<
taskExecutor->InitJsThread(true);
gTaskExecutor = taskExecutor;
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
return AceType::MakeRefPtr<PipelineContext>(
std::move(window), taskExecutor, assetManager, resRegister, frontend, 0);
@ -75,7 +75,7 @@ HWTEST_F(PluginSubContainerTest, PluginSubContainerDestroyTest001, TestSize.Leve
PluginSubContainer pluginSubContainer(pipelineContext);
pluginSubContainer.pipelineContext_ = pipelineContext;
pluginSubContainer.taskExecutor_ = Referenced::MakeRefPtr<FlutterTaskExecutor>();
pluginSubContainer.assetManager_ = Referenced::MakeRefPtr<FakeAssetManager>();
pluginSubContainer.assetManager_ = Referenced::MakeRefPtr<MockAssetManager>();
EXPECT_TRUE(pluginSubContainer.pipelineContext_ != nullptr);
EXPECT_TRUE(pluginSubContainer.taskExecutor_ != nullptr);
EXPECT_TRUE(pluginSubContainer.assetManager_ != nullptr);

View File

@ -81,8 +81,8 @@ HWTEST_F(PluginWindowTest, PluginWindowRequestFrameTest001, TestSize.Level1)
*/
auto platformWindow = PlatformWindow::Create(nullptr);
auto mockPluginWindow = std::make_unique<MockPluginWindow>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = Frontend::CreateDefault();
@ -111,8 +111,8 @@ HWTEST_F(PluginWindowTest, PluginWindowSetVsyncCallbackTest001, TestSize.Level1)
GTEST_LOG_(INFO) << "PluginWindowRequestFrameTest001 is begain";
auto platformWindow = PlatformWindow::Create(nullptr);
auto mockPluginWindow = std::make_unique<MockPluginWindow>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = Frontend::CreateDefault();

View File

@ -120,8 +120,8 @@ public:
{
auto platformWindow = PlatformWindow::Create(nullptr);
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
frontend_ = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(

View File

@ -104,8 +104,8 @@ public:
std::unique_ptr<PlatformWindow> platformWindow = TweenTestUtils::CreatePlatformWindow();
platformWindowRaw_ = reinterpret_cast<MockPlatformWindow*>(platformWindow.get());
auto window = TweenTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = AceType::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = AceType::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
RefPtr<Frontend> frontend = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(

View File

@ -152,8 +152,8 @@ public:
{
auto platformWindow = PlatformWindow::Create(nullptr);
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
frontend_ = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(

View File

@ -144,8 +144,8 @@ void RenderTabContentTest::SetUp()
{
auto platformWindow = PlatformWindow::Create(nullptr);
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
frontend_ = Frontend::CreateDefault();
context_ =

View File

@ -132,8 +132,8 @@ public:
std::unique_ptr<PlatformWindow> platformWindow = TweenTestUtils::CreatePlatformWindow();
platformWindowRaw_ = reinterpret_cast<MockPlatformWindow*>(platformWindow.get());
auto window = TweenTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = AceType::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = AceType::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
RefPtr<Frontend> frontend = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(

View File

@ -133,8 +133,8 @@ public:
std::unique_ptr<PlatformWindow> platformWindow = TweenTestUtils::CreatePlatformWindow();
platformWindowRaw_ = reinterpret_cast<MockPlatformWindow*>(platformWindow.get());
auto window = TweenTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = AceType::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = AceType::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
RefPtr<Frontend> frontend = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(

View File

@ -140,8 +140,8 @@ public:
std::unique_ptr<PlatformWindow> platformWindow = TweenTestUtils::CreatePlatformWindow();
platformWindowRaw_ = reinterpret_cast<MockPlatformWindow*>(platformWindow.get());
auto window = TweenTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = AceType::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = AceType::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
RefPtr<Frontend> frontend = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(

View File

@ -126,8 +126,8 @@ public:
std::unique_ptr<PlatformWindow> platformWindow = TweenTestUtils::CreatePlatformWindow();
platformWindowRaw_ = reinterpret_cast<MockPlatformWindow*>(platformWindow.get());
auto window = TweenTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = AceType::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = AceType::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
RefPtr<Frontend> frontend = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(

View File

@ -247,8 +247,8 @@ HWTEST_F(EventsTest, AsyncEventTrigger002, TestSize.Level0)
*/
auto platformWindow = std::make_unique<TestWindow>(nullptr);
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto frontend = Frontend::CreateDefault();
auto context =
@ -328,8 +328,8 @@ HWTEST_F(EventsTest, SyncEventTrigger002, TestSize.Level0)
*/
auto platformWindow = std::make_unique<TestWindow>(nullptr);
auto window = std::make_unique<Window>(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto frontend = Frontend::CreateDefault();
auto context =

View File

@ -1546,8 +1546,8 @@ HWTEST_F(GesturesTest, PanRecognizer001, TestSize.Level1)
*/
std::unique_ptr<PlatformWindow> platformWindow = GestureTestUtils::CreatePlatformWindow();
auto window = GestureTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = AceType::MakeRefPtr<Framework::MockFrontend>();
@ -1628,8 +1628,8 @@ HWTEST_F(GesturesTest, PanRecognizer002, TestSize.Level1)
*/
std::unique_ptr<PlatformWindow> platformWindow = GestureTestUtils::CreatePlatformWindow();
auto window = GestureTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = AceType::MakeRefPtr<Framework::MockFrontend>();
@ -1711,8 +1711,8 @@ HWTEST_F(GesturesTest, PanRecognizer003, TestSize.Level1)
*/
std::unique_ptr<PlatformWindow> platformWindow = GestureTestUtils::CreatePlatformWindow();
auto window = GestureTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = AceType::MakeRefPtr<Framework::MockFrontend>();
@ -1794,8 +1794,8 @@ HWTEST_F(GesturesTest, PanRecognizer004, TestSize.Level1)
*/
std::unique_ptr<PlatformWindow> platformWindow = GestureTestUtils::CreatePlatformWindow();
auto window = GestureTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = AceType::MakeRefPtr<Framework::MockFrontend>();
@ -1896,8 +1896,8 @@ HWTEST_F(GesturesTest, PanRecognizer005, TestSize.Level1)
*/
std::unique_ptr<PlatformWindow> platformWindow = GestureTestUtils::CreatePlatformWindow();
auto window = GestureTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = AceType::MakeRefPtr<Framework::MockFrontend>();
@ -2003,8 +2003,8 @@ HWTEST_F(GesturesTest, PinchRecognizer001, TestSize.Level1)
*/
std::unique_ptr<PlatformWindow> platformWindow = GestureTestUtils::CreatePlatformWindow();
auto window = GestureTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = AceType::MakeRefPtr<Framework::MockFrontend>();
@ -2102,8 +2102,8 @@ HWTEST_F(GesturesTest, PinchRecognizer002, TestSize.Level1)
*/
std::unique_ptr<PlatformWindow> platformWindow = GestureTestUtils::CreatePlatformWindow();
auto window = GestureTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = AceType::MakeRefPtr<Framework::MockFrontend>();
@ -2226,8 +2226,8 @@ HWTEST_F(GesturesTest, RotationRecognizer001, TestSize.Level1)
*/
std::unique_ptr<PlatformWindow> platformWindow = GestureTestUtils::CreatePlatformWindow();
auto window = GestureTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = AceType::MakeRefPtr<Framework::MockFrontend>();
@ -2315,8 +2315,8 @@ HWTEST_F(GesturesTest, RotationRecognizer002, TestSize.Level1)
*/
std::unique_ptr<PlatformWindow> platformWindow = GestureTestUtils::CreatePlatformWindow();
auto window = GestureTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = AceType::MakeRefPtr<Framework::MockFrontend>();
@ -2425,8 +2425,8 @@ HWTEST_F(GesturesTest, MultiLongPressRecognizer001, TestSize.Level1)
*/
std::unique_ptr<PlatformWindow> platformWindow = GestureTestUtils::CreatePlatformWindow();
auto window = GestureTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = AceType::MakeRefPtr<Framework::MockFrontend>();
@ -2491,8 +2491,8 @@ HWTEST_F(GesturesTest, MultiLongPressRecognizer002, TestSize.Level1)
*/
std::unique_ptr<PlatformWindow> platformWindow = GestureTestUtils::CreatePlatformWindow();
auto window = GestureTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<MockAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
auto fakeFrontend = AceType::MakeRefPtr<Framework::MockFrontend>();

View File

@ -55,7 +55,7 @@ const std::string THREADFOURTH = "thread_4";
RefPtr<PipelineContext> ConstructContext(const RefPtr<Frontend>& frontend)
{
auto taskExecutor = Referenced::MakeRefPtr<FakeTaskExecutor>();
auto taskExecutor = Referenced::MakeRefPtr<MockTaskExecutor>();
auto platformWindow = PlatformWindow::Create(nullptr);
auto window = std::make_unique<Window>(std::move(platformWindow));
auto context = AceType::MakeRefPtr<PipelineContext>(std::move(window), taskExecutor, nullptr, nullptr, frontend, 0);