fixTDDon0813

Signed-off-by: worker0217 <linhao54@huawei.com>
Change-Id: I7589b0b144cbd0a79647c29150923d9457a426b7
This commit is contained in:
worker0217 2024-08-13 21:06:19 +08:00
parent 9ef3e22cc4
commit 764547e142
5 changed files with 7 additions and 5 deletions

View File

@ -1140,6 +1140,8 @@ void OverlayManager::OnPopMenuAnimationFinished(const WeakPtr<FrameNode> menuWK,
auto menuLayoutProp = menuPattern->GetLayoutProperty<MenuLayoutProperty>(); auto menuLayoutProp = menuPattern->GetLayoutProperty<MenuLayoutProperty>();
CHECK_NULL_VOID(menuLayoutProp); CHECK_NULL_VOID(menuLayoutProp);
bool isShowInSubWindow = menuLayoutProp->GetShowInSubWindowValue(true); bool isShowInSubWindow = menuLayoutProp->GetShowInSubWindowValue(true);
auto targetId = menuWrapperPattern->GetTargetId();
overlayManager->EraseMenuInfo(targetId);
if (((menuWrapperPattern && menuWrapperPattern->IsContextMenu()) || (isShowInSubWindow && expandDisplay)) && if (((menuWrapperPattern && menuWrapperPattern->IsContextMenu()) || (isShowInSubWindow && expandDisplay)) &&
(menuPattern->GetTargetTag() != V2::SELECT_ETS_TAG)) { (menuPattern->GetTargetTag() != V2::SELECT_ETS_TAG)) {
SubwindowManager::GetInstance()->ClearMenuNG(instanceId, menuWrapperPattern->GetTargetId()); SubwindowManager::GetInstance()->ClearMenuNG(instanceId, menuWrapperPattern->GetTargetId());

View File

@ -1611,7 +1611,7 @@ HWTEST_F(MenuPatternTestNg, MenuPatternTestNg087, TestSize.Level1)
const RefPtr<InterpolatingSpring> MENU_ANIMATION_CURVE = const RefPtr<InterpolatingSpring> MENU_ANIMATION_CURVE =
AceType::MakeRefPtr<InterpolatingSpring>(VELOCITY, MASS, STIFFNESS, DAMPING); AceType::MakeRefPtr<InterpolatingSpring>(VELOCITY, MASS, STIFFNESS, DAMPING);
menuPattern->ShowStackExpandDisappearAnimation(menuNode, subMenuNode, animationOption); menuPattern->ShowStackExpandDisappearAnimation(menuNode, subMenuNode, animationOption);
EXPECT_EQ(animationOption.curve_, MENU_ANIMATION_CURVE); EXPECT_TRUE(animationOption.curve_->IsEqual(MENU_ANIMATION_CURVE));
} }
/** /**

View File

@ -808,7 +808,7 @@ HWTEST_F(MenuItemGroupTestNg, MenuItemGroupPattern003, TestSize.Level1)
textNode->MountToParent(menuItemGroup2); textNode->MountToParent(menuItemGroup2);
menuItemGroupPattern2->OnIntItemPressed(index, press); menuItemGroupPattern2->OnIntItemPressed(index, press);
auto needHeaderDivider = menuItemGroup3->GetPaintProperty<MenuItemGroupPaintProperty>()->propNeedHeaderDivider_; auto needHeaderDivider = menuItemGroup3->GetPaintProperty<MenuItemGroupPaintProperty>()->propNeedHeaderDivider_;
EXPECT_EQ(needHeaderDivider, std::nullopt); EXPECT_EQ(needHeaderDivider, false);
} }
/** /**

View File

@ -783,11 +783,11 @@ HWTEST_F(OverlayTestNg, MenuTest003, TestSize.Level1)
menuWrapperNode->MountToParent(rootNode); menuWrapperNode->MountToParent(rootNode);
/** /**
* @tc.steps: step2. call PopMenuAnimation when showPreviewAnimation is false * @tc.steps: step2. call PopMenuAnimation when showPreviewAnimation is false
* @tc.expected: the preview node will remove * @tc.expected: the none of node will remove.
*/ */
EXPECT_EQ(menuWrapperNode->GetChildren().size(), 2); EXPECT_EQ(menuWrapperNode->GetChildren().size(), 2);
overlayManager->PopMenuAnimation(menuWrapperNode, false); overlayManager->PopMenuAnimation(menuWrapperNode, false);
EXPECT_EQ(menuWrapperNode->GetChildren().size(), 1); EXPECT_EQ(menuWrapperNode->GetChildren().size(), 2);
} }
/** /**

View File

@ -478,7 +478,7 @@ HWTEST_F(OverlayTestUpdate, ToastTest005, TestSize.Level1)
*/ */
auto styleOption = toastContext->GetBackBlurStyle(); auto styleOption = toastContext->GetBackBlurStyle();
auto testval1 = toastContext->GetBackgroundColorValue(); auto testval1 = toastContext->GetBackgroundColorValue();
auto shadow1 = textContext->GetBackShadow().value(); auto shadow1 = toastContext->GetBackShadow().value();
EXPECT_EQ(testval1, Color::BLUE); EXPECT_EQ(testval1, Color::BLUE);
EXPECT_EQ(styleOption->blurStyle, BlurStyle::NO_MATERIAL); EXPECT_EQ(styleOption->blurStyle, BlurStyle::NO_MATERIAL);
EXPECT_EQ(shadow1, ShadowConfig::DefaultShadowL); EXPECT_EQ(shadow1, ShadowConfig::DefaultShadowL);