!48163 修复FormRenderTest TDD用例

Merge pull request !48163 from wangweihao/master
This commit is contained in:
openharmony_ci 2024-11-11 14:43:14 +00:00 committed by Gitee
commit 143a2585a7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -268,12 +268,10 @@ HWTEST_F(FormRenderTest, FormRenderTest002, TestSize.Level1)
*/
auto formRendererDispatcher = formRenderer->formRendererDispatcherImpl_;
EXPECT_TRUE(formRendererDispatcher);
OHOS::Rosen::WindowSizeChangeReason type = static_cast<OHOS::Rosen::WindowSizeChangeReason>(0);
const std::shared_ptr<Rosen::RSTransaction>& rsTransaction = nullptr;
EXPECT_CALL(*((MockUIContent*)(formRenderer->uiContent_.get())), SetFormWidth(FORM_WIDTH_2)).WillOnce(Return());
EXPECT_CALL(*((MockUIContent*)(formRenderer->uiContent_.get())), SetFormHeight(FORM_HEIGHT_2)).WillOnce(Return());
EXPECT_CALL(*((MockUIContent*)(formRenderer->uiContent_.get())), OnFormSurfaceChange(FORM_WIDTH_2, FORM_HEIGHT_2,
type, rsTransaction)).WillOnce(Return());
_, _)).WillOnce(Return());
formRendererDispatcher->DispatchSurfaceChangeEvent(FORM_WIDTH_2, FORM_HEIGHT_2);
std::this_thread::sleep_for(std::chrono::seconds(1));
EXPECT_EQ(onSurfaceChangeEventKey, CHECK_KEY);
@ -282,7 +280,7 @@ HWTEST_F(FormRenderTest, FormRenderTest002, TestSize.Level1)
EXPECT_CALL(*((MockUIContent*)(formRenderer->uiContent_.get())), SetFormWidth(FORM_WIDTH_2)).WillOnce(Return());
EXPECT_CALL(*((MockUIContent*)(formRenderer->uiContent_.get())), SetFormHeight(FORM_HEIGHT_2)).WillOnce(Return());
EXPECT_CALL(*((MockUIContent*)(formRenderer->uiContent_.get())), OnFormSurfaceChange(FORM_WIDTH_2, FORM_HEIGHT_2,
type, rsTransaction)).WillOnce(Return());
_, _)).WillOnce(Return());
onSurfaceChangeEventKey = "";
formRendererDispatcher->DispatchSurfaceChangeEvent(FORM_WIDTH_2, FORM_HEIGHT_2);
std::this_thread::sleep_for(std::chrono::seconds(1));