fix_shell_command_error

Signed-off-by: zhangkai <zhangkai324@huawei.com>
Change-Id: I995ff89407a2a1a4d040eb60fffe08b2ca31c712
This commit is contained in:
zhangkai 2023-02-23 17:10:59 +08:00
parent 511b4a694f
commit c96bebe8b7
19 changed files with 138 additions and 0 deletions

View File

@ -25,6 +25,7 @@ namespace OHOS {
namespace Rosen {
namespace {
constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowAnimationTest"};
constexpr uint32_t SLEEP_SEC = 1; // 1s
}
using Utils = WindowTestUtils;
@ -113,6 +114,7 @@ HWTEST_F(WindowAnimationTransitionTest, AnimationTransitionTest01, Function | Me
usleep(500000); // 500000us = 0.5s
ASSERT_TRUE(trans_ == window->GetTransform());
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
/**
@ -132,6 +134,7 @@ HWTEST_F(WindowAnimationTransitionTest, AnimationTransitionTest02, Function | Me
usleep(500000); // 500000us = 0.5s
ASSERT_TRUE(defaultTrans_ == window->GetTransform());
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
/**
@ -148,6 +151,7 @@ HWTEST_F(WindowAnimationTransitionTest, AnimationTransitionTest03, Function | Me
usleep(500000); // 500000us = 0.5s
ASSERT_TRUE(defaultTrans_ == window->GetTransform());
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
/**
@ -168,6 +172,7 @@ HWTEST_F(WindowAnimationTransitionTest, AnimationTransitionTest04, Function | Me
ASSERT_EQ(WMError::WM_OK, window->Hide());
ASSERT_TRUE(defaultTrans_ == window->GetTransform());
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
}
} // namespace Rosen

View File

@ -31,6 +31,7 @@ namespace OHOS {
namespace Rosen {
namespace {
constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowAppFloatingWindowTest"};
constexpr uint32_t SLEEP_SEC = 1; // 1s
}
class TestCameraFloatWindowChangedListener : public ICameraFloatWindowChangedListener {
@ -134,6 +135,7 @@ HWTEST_F(WindowAppFloatingWindowTest, AppFloatingWindow01, Function | MediumTest
ASSERT_EQ(WMError::WM_OK, scene->GoBackground());
ASSERT_EQ(WMError::WM_OK, fltWin->Destroy());
sleep(SLEEP_SEC);
ASSERT_EQ(WMError::WM_OK, scene->GoDestroy());
}
@ -160,6 +162,7 @@ HWTEST_F(WindowAppFloatingWindowTest, AppFloatingWindow02, Function | MediumTest
ASSERT_EQ(WMError::WM_OK, fltWin->Hide());
ASSERT_EQ(WMError::WM_OK, fltWin->Destroy());
sleep(SLEEP_SEC);
ASSERT_EQ(WMError::WM_OK, scene->GoDestroy());
}
@ -186,6 +189,7 @@ HWTEST_F(WindowAppFloatingWindowTest, AppFloatingWindow03, Function | MediumTest
ASSERT_EQ(WMError::WM_OK, scene->GoBackground());
ASSERT_EQ(WMError::WM_OK, fltWin->Destroy());
sleep(SLEEP_SEC);
ASSERT_EQ(WMError::WM_OK, scene->GoDestroy());
}
@ -210,6 +214,7 @@ HWTEST_F(WindowAppFloatingWindowTest, AppFloatingWindow04, Function | MediumTest
ASSERT_EQ(nullptr, scene->GetMainWindow());
ASSERT_EQ(false, fltWin->GetWindowState() == WindowState::STATE_SHOWN);
ASSERT_EQ(WMError::WM_OK, fltWin->Destroy());
sleep(SLEEP_SEC);
}
/**
@ -234,6 +239,7 @@ HWTEST_F(WindowAppFloatingWindowTest, AppFloatingWindow05, Function | MediumTest
ASSERT_EQ(WMError::WM_OK, scene->GoBackground());
ASSERT_EQ(WMError::WM_OK, fltWin->Destroy());
sleep(SLEEP_SEC);
ASSERT_EQ(WMError::WM_OK, scene->GoDestroy());
}
@ -261,6 +267,7 @@ HWTEST_F(WindowAppFloatingWindowTest, AppFloatingWindow06, Function | MediumTest
ASSERT_EQ(WMError::WM_OK, fltWin->Hide());
ASSERT_EQ(WMError::WM_OK, fltWin->Destroy());
sleep(SLEEP_SEC);
ASSERT_EQ(WMError::WM_OK, scene->GoDestroy());
}
@ -288,6 +295,7 @@ HWTEST_F(WindowAppFloatingWindowTest, AppFloatingWindow07, Function | MediumTest
ASSERT_EQ(WMError::WM_OK, scene->GoBackground());
ASSERT_EQ(WMError::WM_OK, fltWin->Destroy());
sleep(SLEEP_SEC);
ASSERT_EQ(WMError::WM_OK, scene->GoDestroy());
}
@ -313,6 +321,7 @@ HWTEST_F(WindowAppFloatingWindowTest, AppFloatingWindow08, Function | MediumTest
ASSERT_EQ(nullptr, scene->GetMainWindow());
ASSERT_EQ(false, fltWin->GetWindowState() == WindowState::STATE_SHOWN);
ASSERT_EQ(WMError::WM_OK, fltWin->Destroy());
sleep(SLEEP_SEC);
}
/**
@ -353,6 +362,7 @@ HWTEST_F(WindowAppFloatingWindowTest, AppFloatingWindow09, Function | MediumTest
ASSERT_TRUE(WindowTestUtils::RectEqualTo(fltWin, exceptRect));
ASSERT_EQ(WMError::WM_OK, fltWin->Destroy());
sleep(SLEEP_SEC);
ASSERT_EQ(WMError::WM_OK, scene->GoDestroy());
}
@ -375,10 +385,12 @@ HWTEST_F(WindowAppFloatingWindowTest, AppFloatingWindow10, Function | MediumTest
ASSERT_EQ(nullptr, fltWin2);
ASSERT_EQ(WMError::WM_OK, fltWin->Destroy());
sleep(SLEEP_SEC);
sptr<Window> fltWin3 = CreateAppFloatingWindow(WindowType::WINDOW_TYPE_FLOAT_CAMERA, fltWindRect);
ASSERT_NE(nullptr, fltWin3);
ASSERT_EQ(WMError::WM_OK, fltWin3->Destroy());
sleep(SLEEP_SEC);
ASSERT_EQ(WMError::WM_OK, scene->GoDestroy());
}
@ -413,6 +425,7 @@ HWTEST_F(WindowAppFloatingWindowTest, AppFloatingWindow11, Function | MediumTest
ASSERT_EQ(false, testCameraFloatWindowChangedListener_->isShowing_);
ASSERT_EQ(WMError::WM_OK, fltWin->Destroy());
sleep(SLEEP_SEC);
ASSERT_EQ(WMError::WM_OK, scene->GoDestroy());
WindowManager::GetInstance().UnregisterCameraFloatWindowChangedListener(testCameraFloatWindowChangedListener_);

View File

@ -25,6 +25,8 @@ using namespace testing::ext;
namespace OHOS {
namespace Rosen {
constexpr uint32_t SLEEP_SEC = 1; // 1s
class WindowDialogWindowTest : public testing::Test {
public:
static void SetUpTestCase();
@ -95,7 +97,9 @@ HWTEST_F(WindowDialogWindowTest, DialogWindow01, Function | MediumTest | Level2)
ASSERT_EQ(WMError::WM_OK, scene->GoBackground());
dialogWindow->Destroy();
sleep(SLEEP_SEC);
scene->GoDestroy();
sleep(SLEEP_SEC);
}
/**
@ -122,7 +126,9 @@ HWTEST_F(WindowDialogWindowTest, DialogWindow02, Function | MediumTest | Level2)
ASSERT_EQ(WMError::WM_OK, scene->GoBackground());
dialogWindow0->Destroy();
sleep(SLEEP_SEC);
scene->GoDestroy();
sleep(SLEEP_SEC);
}
/**
@ -148,6 +154,7 @@ HWTEST_F(WindowDialogWindowTest, DialogWindow03, Function | MediumTest | Level2)
ASSERT_EQ(WMError::WM_OK, scene->GoBackground());
dialogWindow0->Destroy();
sleep(SLEEP_SEC);
scene->GoDestroy();
}
@ -173,6 +180,7 @@ HWTEST_F(WindowDialogWindowTest, DialogWindow04, Function | MediumTest | Level2)
ASSERT_NE(nullptr, dialogWindow1);
ASSERT_EQ(WMError::WM_OK, dialogWindow1->Show());
ASSERT_EQ(WMError::WM_OK, dialogWindow1->Destroy());
sleep(SLEEP_SEC);
ASSERT_EQ(WMError::WM_OK, scene->GoBackground());
scene->GoDestroy();
@ -199,6 +207,7 @@ HWTEST_F(WindowDialogWindowTest, DialogWindow05, Function | MediumTest | Level2)
ASSERT_EQ(WMError::WM_OK, dialogWindow->Hide());
dialogWindow->Destroy();
sleep(SLEEP_SEC);
scene->GoDestroy();
}
@ -223,8 +232,10 @@ HWTEST_F(WindowDialogWindowTest, DialogWindow06, Function | MediumTest | Level2)
ASSERT_EQ(WMError::WM_OK, scene->GoBackground());
ASSERT_EQ(WMError::WM_OK, dialogWindow->Destroy());
sleep(SLEEP_SEC);
dialogWindow->Destroy();
sleep(SLEEP_SEC);
scene->GoDestroy();
}
@ -247,7 +258,9 @@ HWTEST_F(WindowDialogWindowTest, DialogWindow07, Function | MediumTest | Level2)
sptr<Window> mainWindow = scene->GetMainWindow();
ASSERT_EQ(WMError::WM_OK, mainWindow->Destroy());
sleep(SLEEP_SEC);
ASSERT_EQ(WMError::WM_OK, dialogWindow->Destroy());
sleep(SLEEP_SEC);
scene->GoDestroy();
}

View File

@ -25,6 +25,8 @@ using namespace testing::ext;
namespace OHOS {
namespace Rosen {
using Utils = WindowTestUtils;
constexpr uint32_t SLEEP_SEC = 1; // 1s
class WindowDisplayZoomTest : public testing::Test {
public:
static void SetUpTestCase();
@ -108,6 +110,7 @@ HWTEST_F(WindowDisplayZoomTest, DisplayZoom01, Function | MediumTest | Level3)
WindowAccessibilityController::GetInstance().OffWindowZoom();
window->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -139,6 +142,7 @@ HWTEST_F(WindowDisplayZoomTest, DisplayZoom02, Function | MediumTest | Level3)
expect.translateX_ = expect.translateY_ = 0;
WindowAccessibilityController::GetInstance().OffWindowZoom();
window->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -164,6 +168,7 @@ HWTEST_F(WindowDisplayZoomTest, DisplayZoom03, Function | MediumTest | Level3)
ASSERT_TRUE(expect == implPtr->GetWindowProperty()->GetZoomTransform());
window->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -200,6 +205,7 @@ HWTEST_F(WindowDisplayZoomTest, DisplayZoom04, Function | MediumTest | Level3)
ASSERT_TRUE(identity == implPtr->GetWindowProperty()->GetZoomTransform());
window->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -242,6 +248,7 @@ HWTEST_F(WindowDisplayZoomTest, DisplayZoom05, Function | MediumTest | Level3)
WindowAccessibilityController::GetInstance().OffWindowZoom();
window->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -268,6 +275,7 @@ HWTEST_F(WindowDisplayZoomTest, DisplayZoom06, Function | MediumTest | Level3)
WindowAccessibilityController::GetInstance().OffWindowZoom();
window->Destroy();
sleep(SLEEP_SEC);
}
}
} // namespace Rosen

View File

@ -101,6 +101,7 @@ void WindowDragTest::SetUp()
void WindowDragTest::TearDown() {
while (!activeWindows_.empty()) {
ASSERT_EQ(WMError::WM_OK, activeWindows_.back()->Destroy());
sleep(WAIT_CALLBACK_US);
activeWindows_.pop_back();
}
}

View File

@ -23,6 +23,8 @@ using namespace testing::ext;
namespace OHOS {
namespace Rosen {
using Utils = WindowTestUtils;
constexpr uint32_t SLEEP_SEC = 1; // 1s
class WindowEffectTest : public testing::Test {
public:
static void SetUpTestCase();
@ -74,6 +76,7 @@ HWTEST_F(WindowEffectTest, WindowEffect01, Function | MediumTest | Level3)
ASSERT_EQ(WMError::WM_OK, window->SetCornerRadius(-1.0));
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
/**
@ -92,6 +95,7 @@ HWTEST_F(WindowEffectTest, WindowEffect02, Function | MediumTest | Level3)
ASSERT_EQ(WMError::WM_ERROR_INVALID_PARAM, window->SetShadowRadius(-1.0));
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
/**
@ -117,6 +121,7 @@ HWTEST_F(WindowEffectTest, WindowEffect03, Function | MediumTest | Level3)
ASSERT_EQ(WMError::WM_ERROR_INVALID_PARAM, window->SetShadowColor("#ff"));
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
/**
@ -140,6 +145,7 @@ HWTEST_F(WindowEffectTest, WindowEffect04, Function | MediumTest | Level3)
window->SetShadowOffsetY(-1.0);
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
/**
@ -158,6 +164,7 @@ HWTEST_F(WindowEffectTest, WindowEffect05, Function | MediumTest | Level3)
ASSERT_EQ(WMError::WM_ERROR_INVALID_PARAM, window->SetBlur(-1.0));
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
/**
@ -176,6 +183,7 @@ HWTEST_F(WindowEffectTest, WindowEffect06, Function | MediumTest | Level3)
ASSERT_EQ(WMError::WM_ERROR_INVALID_PARAM, window->SetBackdropBlur(-1.0));
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
/**
@ -197,6 +205,7 @@ HWTEST_F(WindowEffectTest, WindowEffect07, Function | MediumTest | Level3)
ASSERT_EQ(WMError::WM_ERROR_INVALID_PARAM, window->SetBackdropBlurStyle(static_cast<WindowBlurStyle>(5)));
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
} // namespace
} // namespace Rosen

View File

@ -29,6 +29,7 @@ namespace {
using Utils = WindowTestUtils;
const int WAIT_ASYNC_US = 100000; // 100000us
constexpr uint32_t SLEEP_SEC = 1; // 1s
class TestFocusChangedListener : public IFocusChangedListener {
public:
@ -167,8 +168,11 @@ HWTEST_F(WindowFocusTest, FocusChangedTest01, Function | MediumTest | Level3)
ASSERT_EQ(subWindow->GetWindowId(), testFocusChangedListener_->focusedWindow_);
window1->Destroy();
sleep(SLEEP_SEC);
window2->Destroy();
sleep(SLEEP_SEC);
window3->Destroy();
sleep(SLEEP_SEC);
subWindow->Destroy();
}
@ -200,7 +204,9 @@ HWTEST_F(WindowFocusTest, FocusChangedTest02, Function | MediumTest | Level3)
ASSERT_EQ(mainWindow->GetWindowId(), testFocusChangedListener_->focusedWindow_);
mainWindow->Destroy();
sleep(SLEEP_SEC);
subWindow->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -238,8 +244,11 @@ HWTEST_F(WindowFocusTest, FocusChangedTest03, Function | MediumTest | Level3)
ASSERT_EQ(aboveSubWindow->GetWindowId(), testFocusChangedListener_->focusedWindow_);
mainWindow1->Destroy();
sleep(SLEEP_SEC);
mainWindow2->Destroy();
sleep(SLEEP_SEC);
aboveSubWindow->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -278,8 +287,11 @@ HWTEST_F(WindowFocusTest, FocusChangedTest04, Function | MediumTest | Level3)
ASSERT_EQ(mainWindow1->GetWindowId(), testFocusChangedListener_->focusedWindow_);
mainWindow1->Destroy();
sleep(SLEEP_SEC);
mainWindow2->Destroy();
sleep(SLEEP_SEC);
belowSubWindow->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -327,8 +339,11 @@ HWTEST_F(WindowFocusTest, FocusChangedTest05, Function | MediumTest | Level3)
ASSERT_EQ(mainWindow1->GetWindowId(), testFocusChangedListener_->focusedWindow_);
mainWindow1->Destroy();
sleep(SLEEP_SEC);
mainWindow2->Destroy();
sleep(SLEEP_SEC);
belowSubWindow->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -437,6 +452,7 @@ HWTEST_F(WindowFocusTest, FocusChangedTest07, Function | MediumTest | Level3)
ASSERT_EQ(mainWindow2->GetWindowId(), testFocusChangedListener_->focusedWindow_);
mainWindow2->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -474,6 +490,7 @@ HWTEST_F(WindowFocusTest, FocusChangedTest08, Function | MediumTest | Level3)
ASSERT_EQ(belowSubWindow->GetWindowId(), testFocusChangedListener_->focusedWindow_);
mainWindow1->Destroy();
sleep(SLEEP_SEC);
}
}
} // namespace Rosen

View File

@ -25,6 +25,7 @@ namespace Rosen {
using Utils = WindowTestUtils;
constexpr uint32_t MAX_WAIT_COUNT = 100;
constexpr uint32_t WAIT_DUR = 10 * 1000;
constexpr uint32_t SLEEP_SEC = 1; // 1s
class WindowGamutTest : public testing::Test {
public:
@ -73,6 +74,7 @@ HWTEST_F(WindowGamutTest, IsSupportWideGamut01, Function | MediumTest | Level3)
ASSERT_EQ(true, window->IsSupportWideGamut());
window->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -87,6 +89,7 @@ HWTEST_F(WindowGamutTest, GetColorSpace01, Function | MediumTest | Level3)
ASSERT_EQ(ColorSpace::COLOR_SPACE_DEFAULT, window->GetColorSpace());
window->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -122,6 +125,7 @@ HWTEST_F(WindowGamutTest, SetColorSpace01, Function | MediumTest | Level3)
window->SetColorSpace(colorSpaceBackup); // restore
window->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -142,6 +146,7 @@ HWTEST_F(WindowGamutTest, SetColorSpace02, Function | MediumTest | Level3)
ASSERT_EQ(colorSpaceBackup, window->GetColorSpace());
window->Destroy();
sleep(SLEEP_SEC);
}
} // namespace
} // namespace Rosen

View File

@ -51,6 +51,7 @@ namespace {
using Utils = WindowTestUtils;
const int WAIT_ASYNC_US = 100000; // 100000us
const int SLEEP_SEC = 1; // 1s
class TestSystemBarChangedListener : public ISystemBarChangedListener {
public:
@ -240,6 +241,7 @@ void WindowImmersiveTest::TearDown()
{
while (!activeWindows_.empty()) {
ASSERT_EQ(WMError::WM_OK, activeWindows_.back()->Destroy());
sleep(SLEEP_SEC);
activeWindows_.pop_back();
}
WindowManager::GetInstance().UnregisterSystemBarChangedListener(testSystemBarChangedListener_);

View File

@ -24,6 +24,7 @@ namespace OHOS {
namespace Rosen {
namespace {
constexpr uint32_t WAIT_ASYNC_US = 100000; // 100ms
constexpr uint32_t SLEEP_SEC = 1; // 1s
}
using Utils = WindowTestUtils;
class WindowInputTest : public testing::Test {
@ -112,6 +113,7 @@ HWTEST_F(WindowInputTest, SetTouchHotAreas01, Function | MediumTest | Level3)
ASSERT_TRUE(requestedTouchHotAreas.empty());
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
/**
@ -167,6 +169,7 @@ HWTEST_F(WindowInputTest, SetTouchHotAreas02, Function | MediumTest | Level3)
ASSERT_TRUE(requestedTouchHotAreas.empty());
ASSERT_EQ(WMError::WM_OK, window->Destroy());
sleep(SLEEP_SEC);
}
} // namespace
} // namespace Rosen

View File

@ -36,6 +36,7 @@ public:
static inline float virtualPixelRatio_ = 0.0;
private:
static constexpr uint32_t WAIT_SYANC_US = 100000;
static constexpr uint32_t SLEEP_SEC = 1;
static void InitAvoidArea();
};
@ -92,6 +93,7 @@ void WindowLayoutTest::InitAvoidArea()
window->GetAvoidAreaByType(AvoidAreaType::TYPE_SYSTEM, WindowTestUtils::systemAvoidArea_);
window->Hide();
window->Destroy();
sleep(SLEEP_SEC);
}
void WindowLayoutTest::TearDownTestCase()
@ -107,6 +109,7 @@ void WindowLayoutTest::TearDown()
{
while (!activeWindows_.empty()) {
ASSERT_EQ(WMError::WM_OK, activeWindows_.back()->Destroy());
sleep(SLEEP_SEC);
activeWindows_.pop_back();
}
}

View File

@ -34,6 +34,7 @@ public:
Utils::TestWindowInfo fullAppInfo_2_;
private:
static constexpr uint32_t WAIT_SYANC_US = 100000;
static constexpr uint32_t SLEEP_SEC = 1;
};
void WindowModeSupportInfoTest::SetUpTestCase()
@ -87,6 +88,7 @@ HWTEST_F(WindowModeSupportInfoTest, WindowModeSupportInfo01, Function | MediumTe
window->SetRequestModeSupportInfo(WindowModeSupport::WINDOW_MODE_SUPPORT_FULLSCREEN);
ASSERT_EQ(WindowModeSupport::WINDOW_MODE_SUPPORT_FULLSCREEN, window->GetRequestModeSupportInfo());
window->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -113,6 +115,7 @@ HWTEST_F(WindowModeSupportInfoTest, WindowModeSupportInfo02, Function | MediumTe
ASSERT_EQ(WMError::WM_OK, window->Hide());
window->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -143,6 +146,7 @@ HWTEST_F(WindowModeSupportInfoTest, WindowModeSupportInfo03, Function | MediumTe
ASSERT_EQ(WMError::WM_OK, window->Hide());
window->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -159,6 +163,7 @@ HWTEST_F(WindowModeSupportInfoTest, WindowModeSupportInfo04, Function | MediumTe
ASSERT_NE(WMError::WM_OK, window->Show());
ASSERT_EQ(WMError::WM_OK, window->Hide());
window->Destroy();
sleep(SLEEP_SEC);
}
/**
@ -182,6 +187,7 @@ HWTEST_F(WindowModeSupportInfoTest, WindowModeSupportInfo05, Function | MediumTe
window1->Destroy();
window2->Destroy();
sleep(SLEEP_SEC);
}
/**

View File

@ -62,6 +62,7 @@ void WindowRaiseToAppTopTest::TearDown()
{
while (!activeWindows_.empty()) {
ASSERT_EQ(WMError::WM_OK, activeWindows_.back()->Destroy());
sleep(TEST_SLEEP_S);
activeWindows_.pop_back();
}
}

View File

@ -119,6 +119,7 @@ void WindowRotationTest::TearDown()
{
while (!activeWindows_.empty()) {
ASSERT_EQ(WMError::WM_OK, activeWindows_.back()->Destroy());
sleep(SPLIT_TEST_SLEEP_S);
activeWindows_.pop_back();
}
DisplayManager::GetInstance().UnregisterDisplayListener(displayListener_);

View File

@ -80,6 +80,7 @@ void WindowSplitImmersiveTest::TearDown()
{
while (!activeWindows_.empty()) {
ASSERT_EQ(WMError::WM_OK, activeWindows_.back()->Destroy());
sleep(1);
activeWindows_.pop_back();
}
}

View File

@ -74,6 +74,7 @@ void WindowSplitTest::TearDown()
{
while (!activeWindows_.empty()) {
ASSERT_EQ(WMError::WM_OK, activeWindows_.back()->Destroy());
sleep(1);
activeWindows_.pop_back();
}
}

View File

@ -97,7 +97,9 @@ HWTEST_F(WindowSubWindowTest, SubWindow01, Function | MediumTest | Level2)
sleep(1);
subWindow->Destroy();
sleep(1);
scene->GoDestroy();
sleep(1);
}
/**
@ -122,7 +124,9 @@ HWTEST_F(WindowSubWindowTest, SubWindow02, Function | MediumTest | Level2)
sleep(1);
subWindow->Destroy();
sleep(1);
scene->GoDestroy();
sleep(1);
}
/**
@ -147,7 +151,9 @@ HWTEST_F(WindowSubWindowTest, SubWindow03, Function | MediumTest | Level2)
sleep(1);
subWindow->Destroy();
sleep(1);
scene->GoDestroy();
sleep(1);
}
/**
@ -172,7 +178,9 @@ HWTEST_F(WindowSubWindowTest, SubWindow04, Function | MediumTest | Level2)
sleep(1);
subWindow->Destroy();
sleep(1);
scene->GoDestroy();
sleep(1);
}
/**
@ -202,8 +210,11 @@ HWTEST_F(WindowSubWindowTest, SubWindow05, Function | MediumTest | Level3)
sleep(1);
subWindow->Destroy();
sleep(1);
subWindow2->Destroy();
sleep(1);
scene->GoDestroy();
sleep(1);
}
/**
@ -232,8 +243,11 @@ HWTEST_F(WindowSubWindowTest, SubWindow06, Function | MediumTest | Level3)
sleep(1);
subWindow0->Destroy();
sleep(1);
subWindow1->Destroy();
sleep(1);
scene->GoDestroy();
sleep(1);
}
/**
@ -258,7 +272,9 @@ HWTEST_F(WindowSubWindowTest, SubWindow07, Function | MediumTest | Level4)
sleep(1);
subWindow->Destroy();
sleep(1);
scene->GoDestroy();
sleep(1);
}
/**
@ -302,7 +318,9 @@ HWTEST_F(WindowSubWindowTest, SubWindow09, Function | MediumTest | Level2)
ASSERT_EQ(WMError::WM_OK, subWindow->Destroy());
subWindow->Destroy();
sleep(1);
scene->GoDestroy();
sleep(1);
}
/**
@ -328,6 +346,7 @@ HWTEST_F(WindowSubWindowTest, SubWindow10, Function | MediumTest | Level2)
ASSERT_EQ(WMError::WM_OK, subWindow->Destroy());
scene->GoDestroy();
sleep(1);
}
/**
@ -371,11 +390,17 @@ HWTEST_F(WindowSubWindowTest, SubWindow11, Function | MediumTest | Level3)
sleep(1);
subWindow0->Destroy();
sleep(1);
subWindow1->Destroy();
sleep(1);
subWindow2->Destroy();
sleep(1);
subWindow3->Destroy();
sleep(1);
subWindow4->Destroy();
sleep(1);
scene->GoDestroy();
sleep(1);
}
/**
@ -401,7 +426,9 @@ HWTEST_F(WindowSubWindowTest, SubWindow12, Function | MediumTest | Level3)
sleep(1);
subWindow0->Destroy();
sleep(1);
scene->GoDestroy();
sleep(1);
}
/**
@ -419,16 +446,19 @@ HWTEST_F(WindowSubWindowTest, SubWindow13, Function | MediumTest | Level3)
ASSERT_NE(nullptr, subWindow0);
ASSERT_EQ(WMError::WM_OK, subWindow0->Show());
ASSERT_EQ(WMError::WM_OK, subWindow0->Destroy());
sleep(1);
sptr<Window> subWindow1 = CreateSubWindow(scene, WindowType::WINDOW_TYPE_APP_SUB_WINDOW, rect, 0, "sub1");
ASSERT_NE(nullptr, subWindow1);
ASSERT_EQ(WMError::WM_OK, subWindow1->Show());
ASSERT_EQ(WMError::WM_OK, subWindow1->Destroy());
sleep(1);
ASSERT_EQ(WMError::WM_OK, scene->GoBackground());
sleep(1);
scene->GoDestroy();
sleep(1);
}
} // namespace Rosen
} // namespace OHOS

View File

@ -126,7 +126,9 @@ HWTEST_F(WindowSystemSubWindowTest, SystemSubWindow01, Function | MediumTest | L
ASSERT_EQ(WMError::WM_OK, baseWindow->Hide());
ASSERT_EQ(WMError::WM_OK, subWindow->Destroy());
sleep(1);
ASSERT_EQ(WMError::WM_OK, baseWindow->Destroy());
sleep(1);
}
}
@ -180,7 +182,9 @@ HWTEST_F(WindowSystemSubWindowTest, SystemSubWindow02, Function | MediumTest | L
ASSERT_EQ(WMError::WM_OK, baseWindow->Hide());
ASSERT_EQ(WMError::WM_OK, subWindow->Destroy());
sleep(1);
ASSERT_EQ(WMError::WM_OK, baseWindow->Destroy());
sleep(1);
}
}
@ -232,7 +236,9 @@ HWTEST_F(WindowSystemSubWindowTest, SystemSubWindow04, Function | MediumTest | L
sptr<Window> subWindow = CreateSystemSubWindow(appSubWindow, rect, flags);
ASSERT_EQ(nullptr, subWindow);
ASSERT_EQ(WMError::WM_OK, appSubWindow->Destroy());
sleep(1);
ASSERT_EQ(WMError::WM_OK, baseWindow->Destroy());
sleep(1);
}
}
@ -263,7 +269,9 @@ HWTEST_F(WindowSystemSubWindowTest, SystemSubWindow05, Function | MediumTest | L
ASSERT_EQ(WMError::WM_OK, baseWindow->Hide());
ASSERT_EQ(WMError::WM_OK, systemSubWindow->Destroy());
sleep(1);
ASSERT_EQ(WMError::WM_OK, baseWindow->Destroy());
sleep(1);
}
/**
@ -299,7 +307,9 @@ HWTEST_F(WindowSystemSubWindowTest, SystemSubWindow06, Function | MediumTest | L
ASSERT_EQ(WMError::WM_OK, baseWindow->Hide());
ASSERT_EQ(WMError::WM_OK, subWindow->Destroy());
sleep(1);
ASSERT_EQ(WMError::WM_OK, baseWindow->Destroy());
sleep(1);
}
/**
* @tc.name: SystemSubWindow07
@ -318,6 +328,7 @@ HWTEST_F(WindowSystemSubWindowTest, SystemSubWindow07, Function | MediumTest | L
sptr<Window> subWindow = CreateSystemSubWindow(baseWindow, rect, flags);
ASSERT_EQ(nullptr, subWindow);
ASSERT_EQ(WMError::WM_OK, baseWindow->Destroy());
sleep(1);
}
} // namespace Rosen
} // namespace OHOS

View File

@ -119,6 +119,7 @@ HWTEST_F(WindowTouchOutsideTest, onTouchInside, Function | MediumTest | Level3)
usleep(WAIT_CALLBACK_US);
ASSERT_TRUE(!windowlistener1_->isTouchOutside_);
firstWindow->Destroy();
sleep(1);
}
/**
@ -137,7 +138,9 @@ HWTEST_F(WindowTouchOutsideTest, onTouchOutside, Function | MediumTest | Level3)
usleep(WAIT_CALLBACK_US);
ASSERT_TRUE(windowlistener1_->isTouchOutside_);
firstWindow->Destroy();
sleep(1);
secondWindow->Destroy();
sleep(1);
}
/**
@ -155,7 +158,9 @@ HWTEST_F(WindowTouchOutsideTest, onTouchOutsideNotShow, Function | MediumTest |
usleep(WAIT_CALLBACK_US);
ASSERT_TRUE(!windowlistener1_->isTouchOutside_);
firstWindow->Destroy();
sleep(1);
secondWindow->Destroy();
sleep(1);
}
/**
@ -180,8 +185,11 @@ HWTEST_F(WindowTouchOutsideTest, onTouchOutsideForAllWindow, Function | MediumTe
ASSERT_TRUE(windowlistener1_->isTouchOutside_);
ASSERT_TRUE(windowlistener2_->isTouchOutside_);
firstWindow->Destroy();
sleep(1);
secondWindow->Destroy();
sleep(1);
thirdWindow->Destroy();
sleep(1);
}
} // namespace
} // Rosen