mirror of
https://gitee.com/openharmony/window_window_manager
synced 2025-03-04 13:48:52 +00:00
dm里测试用例的黄蓝隔离
Signed-off-by: 张有康 <zhangyoukang@h-partners.com>
This commit is contained in:
parent
18993a86bb
commit
d51d6bade5
@ -427,11 +427,7 @@ HWTEST_F(DisplayManagerAdapterTest, DestroyVirtualScreen, Function | SmallTest |
|
||||
VirtualScreenOption defaultOption = {"virtualScreen01", 480, 320, 2.0, nullptr, 0};
|
||||
ScreenId id = ScreenManager::GetInstance().CreateVirtualScreen(defaultOption);
|
||||
DMError err = SingletonContainer::Get<ScreenManagerAdapter>().DestroyVirtualScreen(id);
|
||||
if (!SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
ASSERT_EQ(err, DMError::DM_ERROR_INVALID_CALLING);
|
||||
} else {
|
||||
ASSERT_EQ(err, DMError::DM_OK);
|
||||
}
|
||||
ASSERT_EQ(err, DMError::DM_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -493,7 +489,11 @@ HWTEST_F(DisplayManagerAdapterTest, SetSpecifiedScreenPower, Function | SmallTes
|
||||
ScreenPowerState state = ScreenPowerState{0};
|
||||
PowerStateChangeReason reason = PowerStateChangeReason{0};
|
||||
bool ret = SingletonContainer::Get<ScreenManagerAdapter>().SetSpecifiedScreenPower(0, state, reason);
|
||||
ASSERT_TRUE(ret);
|
||||
if (SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
ASSERT_TRUE(ret);
|
||||
} else {
|
||||
ASSERT_FALSE(ret);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -808,11 +808,7 @@ HWTEST_F(DisplayManagerAdapterTest, GetAllDisplayPhysicalResolution, Function |
|
||||
{
|
||||
std::vector<DisplayPhysicalResolution> allSize =
|
||||
SingletonContainer::Get<DisplayManagerAdapter>().GetAllDisplayPhysicalResolution();
|
||||
if (SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
ASSERT_TRUE(!allSize.empty());
|
||||
} else {
|
||||
ASSERT_TRUE(allSize.empty());
|
||||
}
|
||||
ASSERT_TRUE(!allSize.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -989,11 +989,7 @@ HWTEST_F(DisplayManagerTest, isinsideof, Function | SmallTest | Level1)
|
||||
HWTEST_F(DisplayManagerTest, GetAllDisplayPhysicalResolution, Function | SmallTest | Level1)
|
||||
{
|
||||
std::vector<DisplayPhysicalResolution> allSize = DisplayManager::GetInstance().GetAllDisplayPhysicalResolution();
|
||||
if (SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
ASSERT_TRUE(!allSize.empty());
|
||||
} else {
|
||||
ASSERT_TRUE(allSize.empty());
|
||||
}
|
||||
ASSERT_TRUE(!allSize.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "mock_display_manager_adapter.h"
|
||||
#include "singleton_mocker.h"
|
||||
#include "display_cutout_controller.h"
|
||||
#include "scene_board_judgement.h"
|
||||
|
||||
using namespace testing;
|
||||
using namespace testing::ext;
|
||||
@ -186,7 +187,11 @@ HWTEST_F(DisplayTest, HasImmersiveWindow, Function | SmallTest | Level1)
|
||||
{
|
||||
bool immersive = false;
|
||||
DMError ret = defaultDisplay_->HasImmersiveWindow(immersive);
|
||||
ASSERT_EQ(ret, DMError::DM_OK);
|
||||
if (SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
ASSERT_EQ(ret, DMError::DM_OK);
|
||||
} else {
|
||||
ASSERT_NE(ret, DMError::DM_OK);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -197,7 +202,11 @@ HWTEST_F(DisplayTest, HasImmersiveWindow, Function | SmallTest | Level1)
|
||||
HWTEST_F(DisplayTest, GetPhysicalWidth, Function | SmallTest | Level1)
|
||||
{
|
||||
auto physicalwidth = defaultDisplay_->GetPhysicalWidth();
|
||||
ASSERT_NE(physicalwidth, 0);
|
||||
if (SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
ASSERT_NE(physicalwidth, 0);
|
||||
} else {
|
||||
ASSERT_EQ(physicalwidth, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -208,7 +217,11 @@ HWTEST_F(DisplayTest, GetPhysicalWidth, Function | SmallTest | Level1)
|
||||
HWTEST_F(DisplayTest, GetPhysicalHeight, Function | SmallTest | Level1)
|
||||
{
|
||||
auto physicalheight = defaultDisplay_->GetPhysicalHeight();
|
||||
ASSERT_NE(physicalheight, 0);
|
||||
if (SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
ASSERT_NE(physicalheight, 0);
|
||||
} else {
|
||||
ASSERT_EQ(physicalheight, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "screen_manager_utils.h"
|
||||
#include "mock_display_manager_adapter.h"
|
||||
#include "singleton_mocker.h"
|
||||
#include "scene_board_judgement.h"
|
||||
|
||||
using namespace testing;
|
||||
using namespace testing::ext;
|
||||
@ -422,7 +423,11 @@ HWTEST_F(ScreenTest, SetDensityDpiSystem, Function | SmallTest | Level2)
|
||||
ASSERT_EQ(DMError::DM_ERROR_INVALID_PARAM, res);
|
||||
|
||||
res = screen_->SetDensityDpiSystem(100);
|
||||
ASSERT_EQ(DMError::DM_OK, res);
|
||||
if (SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
ASSERT_EQ(DMError::DM_OK, res);
|
||||
} else {
|
||||
ASSERT_NE(DMError::DM_OK, res);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "abstract_display_controller.h"
|
||||
#include "display_cutout_controller.h"
|
||||
#include "screen.h"
|
||||
#include "scene_board_judgement.h"
|
||||
|
||||
using namespace testing;
|
||||
using namespace testing::ext;
|
||||
@ -574,7 +575,7 @@ HWTEST_F(AbstractDisplayControllerTest, GetScreenSnapshot03, Function | SmallTes
|
||||
{
|
||||
ScreenId screenId = 1;
|
||||
auto ret = absDisplayController_->GetScreenSnapshot(screenId);
|
||||
ASSERT_NE(nullptr, ret);
|
||||
ASSERT_EQ(nullptr, ret);
|
||||
}
|
||||
}
|
||||
} // namespace Rosen
|
||||
|
@ -943,8 +943,13 @@ HWTEST_F(ScreenManagerTest, ScreenManager16, Function | MediumTest | Level2)
|
||||
ScreenId screenId = screenListener->changeFuture_.GetResult(TIME_OUT);
|
||||
ASSERT_EQ(screenId, screens[0]->GetId());
|
||||
usleep(1E6);
|
||||
ASSERT_EQ(static_cast<uint32_t>(screens[0]->GetOrientation()),
|
||||
if (SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
ASSERT_EQ(static_cast<uint32_t>(screens[0]->GetOrientation()),
|
||||
static_cast<uint32_t>(Orientation::UNSPECIFIED));
|
||||
} else {
|
||||
ASSERT_NE(static_cast<uint32_t>(screens[0]->GetOrientation()),
|
||||
static_cast<uint32_t>(Orientation::UNSPECIFIED));
|
||||
}
|
||||
ASSERT_EQ(static_cast<uint32_t>(display->GetOrientation()), orientation);
|
||||
sleep(TEST_SLEEP_S);
|
||||
}
|
||||
@ -1216,7 +1221,11 @@ HWTEST_F(ScreenManagerTest, SetVirtualScreenRefreshRate02, Function | MediumTest
|
||||
|
||||
DMError res = ScreenManager::GetInstance().SetVirtualScreenRefreshRate(virtualScreenId, refreshIntervalZero_);
|
||||
sleep(TEST_SLEEP_S);
|
||||
ASSERT_EQ(DMError::DM_ERROR_INVALID_PARAM, res);
|
||||
if (SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
ASSERT_EQ(DMError::DM_ERROR_INVALID_PARAM, res);
|
||||
} else {
|
||||
ASSERT_NE(DMError::DM_ERROR_INVALID_PARAM, res);
|
||||
}
|
||||
|
||||
ScreenManager::GetInstance().DestroyVirtualScreen(virtualScreenId);
|
||||
}
|
||||
@ -1246,7 +1255,11 @@ HWTEST_F(ScreenManagerTest, SetVirtualScreenRefreshRate03, Function | MediumTest
|
||||
|
||||
DMError res = ScreenManager::GetInstance().SetVirtualScreenRefreshRate(virtualScreenId, refreshIntervalMax_);
|
||||
sleep(TEST_SLEEP_S);
|
||||
ASSERT_EQ(DMError::DM_ERROR_INVALID_PARAM, res);
|
||||
if (SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
ASSERT_EQ(DMError::DM_ERROR_INVALID_PARAM, res);
|
||||
} else {
|
||||
ASSERT_NE(DMError::DM_ERROR_INVALID_PARAM, res);
|
||||
}
|
||||
|
||||
ScreenManager::GetInstance().DestroyVirtualScreen(virtualScreenId);
|
||||
}
|
||||
@ -1255,7 +1268,11 @@ HWTEST_F(ScreenManagerTest, SetVirtualScreenRefreshRate04, Function | MediumTest
|
||||
{
|
||||
DMError res = ScreenManager::GetInstance().SetVirtualScreenRefreshRate(defaultScreenId_, refreshIntervalTwo_);
|
||||
sleep(TEST_SLEEP_S);
|
||||
ASSERT_EQ(DMError::DM_ERROR_INVALID_PARAM, res);
|
||||
if (SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
ASSERT_EQ(DMError::DM_ERROR_INVALID_PARAM, res);
|
||||
} else {
|
||||
ASSERT_NE(DMError::DM_ERROR_INVALID_PARAM, res);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace Rosen
|
||||
|
Loading…
x
Reference in New Issue
Block a user