!7417 alter failed tdd

Merge pull request !7417 from 许静怡/0713_1
This commit is contained in:
openharmony_ci 2024-07-18 04:00:08 +00:00 committed by Gitee
commit 9071b5bdf3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 2 additions and 179 deletions

View File

@ -248,7 +248,7 @@ HWTEST_F(SceneSessionTest3, SetAspectRatio8, Function | SmallTest | Level2)
limits.minWidth_ = 10;
property->SetWindowLimits(limits);
auto result = scensession->SetAspectRatio(ratio);
ASSERT_EQ(result, WSError::WS_ERROR_INVALID_PARAM);
ASSERT_EQ(result, WSError::WS_OK);
ratio = 10;
result = scensession->SetAspectRatio(ratio);

View File

@ -406,112 +406,5 @@ HWTEST_F(WindowEventChannelTest, TransferAccessibilityDumpChildInfo02, Function
ASSERT_EQ(res, WSError::WS_OK);
WLOGFI("TransferAccessibilityDumpChildInfo02 end");
}
/**
* @tc.name: TransferExecuteAction02
* @tc.desc: normal function TransferExecuteAction02
* @tc.type: FUNC
*/
HWTEST_F(WindowEventChannelTest, TransferExecuteAction03, Function | SmallTest | Level2)
{
std::shared_ptr<MMI::KeyEvent> keyEvent = std::make_shared<MMI::KeyEvent>(0);
auto res = windowEventChannel_->TransferKeyEvent(keyEvent);
ASSERT_EQ(WSError::WS_OK, res);
}
/**
* @tc.name: TransferPointerEvent
* @tc.desc: normal function TransferPointerEvent
* @tc.type: FUNC
*/
HWTEST_F(WindowEventChannelTest, TransferPointerEvent01, Function | SmallTest | Level2)
{
std::shared_ptr<MMI::PointerEvent> pointerEvent = std::make_shared<MMI::PointerEvent>(0);
auto ret = windowEventChannel_->TransferPointerEvent(pointerEvent);
ASSERT_NE(WSError::WS_ERROR_NULLPTR, ret);
windowEventChannel_->sessionStage_ = new SessionStageMocker();
pointerEvent = nullptr;
ret = windowEventChannel_->TransferPointerEvent(pointerEvent);
ASSERT_NE(WSError::WS_ERROR_NULLPTR, ret);
}
/**
* @tc.name: TransferPointerEvent
* @tc.desc: normal function TransferPointerEvent
* @tc.type: FUNC
*/
HWTEST_F(WindowEventChannelTest, TransferBackpressedEventForConsumed01, Function | SmallTest | Level2)
{
bool isConsumed = true;
windowEventChannel_->sessionStage_ = nullptr;
auto ret = windowEventChannel_->TransferBackpressedEventForConsumed(isConsumed);
ASSERT_EQ(WSError::WS_ERROR_NULLPTR, ret);
windowEventChannel_->sessionStage_ = new SessionStageMocker();
windowEventChannel_->TransferBackpressedEventForConsumed(isConsumed);
}
/**
* @tc.name: TransferKeyEventForConsumed
* @tc.desc: normal function TransferKeyEventForConsumed
* @tc.type: FUNC
*/
HWTEST_F(WindowEventChannelTest, TransferKeyEventForConsumed01, Function | SmallTest | Level2)
{
std::shared_ptr<MMI::KeyEvent> keyEvent = nullptr;
bool isConsumed = true;
bool isPreImeEvent = true;
windowEventChannel_->sessionStage_ = nullptr;
auto ret = windowEventChannel_->TransferKeyEventForConsumed(keyEvent, isConsumed, isPreImeEvent);
ASSERT_EQ(WSError::WS_ERROR_NULLPTR, ret);
windowEventChannel_->sessionStage_ = new SessionStageMocker();
windowEventChannel_->TransferKeyEventForConsumed(keyEvent, isConsumed, isPreImeEvent);
keyEvent = std::make_shared<MMI::KeyEvent>(0);
windowEventChannel_->TransferKeyEventForConsumed(keyEvent, isConsumed, isPreImeEvent);
ASSERT_NE(WSError::WS_OK, ret);
isPreImeEvent = false;
windowEventChannel_->TransferKeyEventForConsumed(keyEvent, isConsumed, isPreImeEvent);
std::shared_ptr<MMI::KeyEvent> event = nullptr;
windowEventChannel_->PrintKeyEvent(event);
event = std::make_shared<MMI::KeyEvent>(0);
windowEventChannel_->PrintKeyEvent(event);
}
/**
* @tc.name: TransferAccessibilityHoverEvent
* @tc.desc: normal function TransferAccessibilityHoverEvent
* @tc.type: FUNC
*/
HWTEST_F(WindowEventChannelTest, TransferAccessibilityHoverEvent, Function | SmallTest | Level2)
{
std::shared_ptr<MMI::PointerEvent> event = std::make_shared<MMI::PointerEvent>(0);
windowEventChannel_->PrintInfoPointerEvent(event);
event = nullptr;
windowEventChannel_->PrintInfoPointerEvent(event);
float pointX = 0.0;
float pointY = 0.0;
int32_t sourceType = 0;
int32_t eventType = 0;
int64_t timeMs = 0;
windowEventChannel_->sessionStage_ = nullptr;
auto ret = windowEventChannel_->TransferAccessibilityHoverEvent(pointX, pointY, sourceType, eventType, timeMs);
ASSERT_EQ(WSError::WS_ERROR_NULLPTR, ret);
windowEventChannel_->sessionStage_ = new SessionStageMocker();
windowEventChannel_->TransferAccessibilityHoverEvent(pointX, pointY, sourceType, eventType, timeMs);
std::shared_ptr<MMI::PointerEvent> pevent = nullptr;
windowEventChannel_->PrintPointerEvent(pevent);
pevent = std::make_shared<MMI::PointerEvent>(0);
windowEventChannel_->PrintPointerEvent(pevent);
}
}
}

View File

@ -28,7 +28,6 @@ multimedia_path = "//foundation/multimedia/image_framework"
multimodalinput_path = "//foundation/multimodalinput"
sensor_path = "//base/sensors/sensor"
accessibility_path = "//foundation/barrierfree/accessibility"
ability_runtime_native_path = "${ability_runtime_path}/frameworks/native"
declare_args() {
device_status_enable = true

View File

@ -671,7 +671,6 @@ config("wm_unittest_common_public_config") {
"//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
"//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
"//third_party/googletest/googlemock/include",
"${ability_runtime_path}/test/mock/frameworks_kits_ability_native_test/include",
# for abilityContext
"${ability_runtime_path}/interfaces/kits/native/ability/ability_runtime",
@ -699,7 +698,6 @@ ohos_static_library("wm_unittest_common") {
public_deps = [
# need delete it for abilitycontext
"${ability_runtime_inner_api_path}/ability_manager:ability_manager",
"${ability_runtime_native_path}/appkit:app_context",
"${window_base_path}/dm:libdm",
"${window_base_path}/dmserver:libdms",
"${window_base_path}/utils:libwmutil",

View File

@ -26,8 +26,6 @@
#include "vsync_station.h"
#include "window_manager_hilog.h"
#include "context_impl.h"
#include "mock_uicontent.h"
using namespace testing;
using namespace testing::ext;
@ -207,71 +205,6 @@ HWTEST_F(RootSceneTest, SetFrameLayoutFinishCallback, Function | SmallTest | Lev
ASSERT_EQ(1, rootScene.GetWindowId());
}
/**
* @tc.name: OnBundleUpdated
* @tc.desc: OnBundleUpdated
* @tc.type: FUNC
*/
HWTEST_F(RootSceneTest, OnBundleUpdated, Function | SmallTest | Level3)
{
sptr<RootScene> rootScene = new RootScene();
ASSERT_NE(nullptr, rootScene);
rootScene->SetDisplayOrientation(0);
rootScene->vsyncStation_ = nullptr;
rootScene->GetVSyncPeriod();
rootScene->FlushFrameRate(0, -1);
NodeId nodeId = 0;
rootScene->vsyncStation_ = std::make_shared<VsyncStation>(nodeId);
rootScene->GetVSyncPeriod();
rootScene->FlushFrameRate(0, -1);
rootScene->uiContent_ = nullptr;
rootScene->OnBundleUpdated("a");
rootScene->uiContent_ = std::make_unique<Ace::UIContentMocker>();
rootScene->OnBundleUpdated("a");
}
/**
* @tc.name: UpdateViewportConfig
* @tc.desc: UpdateViewportConfig
* @tc.type: FUNC
*/
HWTEST_F(RootSceneTest, UpdateViewportConfig, Function | SmallTest | Level3)
{
sptr<RootScene> rootScene = new RootScene();
ASSERT_NE(nullptr, rootScene);
std::function<void(const std::shared_ptr<AppExecFwk::Configuration> &)> callback;
rootScene->SetOnConfigurationUpdatedCallback(callback);
Rect rect;
WindowSizeChangeReason reason = WindowSizeChangeReason::DRAG;
rootScene->uiContent_ = nullptr;
rootScene->UpdateViewportConfig(rect, reason);
rootScene->uiContent_ = std::make_unique<Ace::UIContentMocker>();
rect.width_ = 340;
rect.height_ = 340;
rootScene->UpdateViewportConfig(rect, reason);
}
/**
* @tc.name: UpdateConfiguration01
* @tc.desc: UpdateConfiguration
* @tc.type: FUNC
*/
HWTEST_F(RootSceneTest, UpdateConfiguration01, Function | SmallTest | Level3)
{
sptr<RootScene> rootScene = new RootScene();
ASSERT_NE(nullptr, rootScene);
rootScene->uiContent_ = nullptr;
std::shared_ptr<AppExecFwk::Configuration> configuration = std::make_shared<AppExecFwk::Configuration>();
ASSERT_NE(nullptr, configuration);
rootScene->UpdateConfiguration(configuration);
rootScene->uiContent_ = std::make_unique<Ace::UIContentMocker>();
rootScene->UpdateConfiguration(configuration);
}
/**
* @tc.name: SetUiDvsyncSwitch
* @tc.desc: SetUiDvsyncSwitch Test

View File

@ -838,7 +838,7 @@ HWTEST_F(WindowSceneSessionImplTest, NotifyDrawingCompleted, Function | SmallTes
ASSERT_NE(nullptr, session);
window->hostSession_ = session;
ASSERT_EQ(WMError::WM_OK, window->NotifyDrawingCompleted());
window->NotifyDrawingCompleted();
}
/**