mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-20 20:20:13 -04:00
@@ -220,6 +220,7 @@ HWTEST_F(DisplayChangeTest, CheckDisplayStateChange01, Function | SmallTest | Le
|
||||
{
|
||||
WLOGFI("CheckDisplayStateChange01");
|
||||
sptr<Display> defaultDisplay = DisplayManager::GetInstance().GetDisplayById(defaultDisplayId_);
|
||||
ASSERT_NE(nullptr, defaultDisplay);
|
||||
ScreenId screenId = defaultDisplay->GetScreenId();
|
||||
sptr<Screen> screen = ScreenManager::GetInstance().GetScreenById(screenId);
|
||||
ASSERT_NE(nullptr, screen);
|
||||
@@ -238,6 +239,7 @@ HWTEST_F(DisplayChangeTest, CheckDisplayStateChange02, Function | SmallTest | Le
|
||||
{
|
||||
WLOGFI("CheckDisplayStateChange02");
|
||||
sptr<Display> defaultDisplay = DisplayManager::GetInstance().GetDisplayById(defaultDisplayId_);
|
||||
ASSERT_NE(nullptr, defaultDisplay);
|
||||
ScreenId screenId = defaultDisplay->GetScreenId();
|
||||
sptr<Screen> screen = ScreenManager::GetInstance().GetScreenById(screenId);
|
||||
ASSERT_NE(nullptr, screen);
|
||||
@@ -270,6 +272,7 @@ HWTEST_F(DisplayChangeTest, CheckDisplaySizeChange01, Function | MediumTest | Le
|
||||
{
|
||||
WLOGFI("CheckDisplaySizeChange01");
|
||||
sptr<Display> defaultDisplay = DisplayManager::GetInstance().GetDisplayById(defaultDisplayId_);
|
||||
ASSERT_NE(nullptr, defaultDisplay);
|
||||
ScreenId screenId = defaultDisplay->GetScreenId();
|
||||
sptr<Screen> screen = ScreenManager::GetInstance().GetScreenById(screenId);
|
||||
ASSERT_NE(nullptr, screen);
|
||||
@@ -302,6 +305,7 @@ HWTEST_F(DisplayChangeTest, CheckDisplaySizeChange02, Function | MediumTest | Le
|
||||
{
|
||||
WLOGFI("CheckDisplaySizeChange02");
|
||||
sptr<Display> defaultDisplay = DisplayManager::GetInstance().GetDisplayById(defaultDisplayId_);
|
||||
ASSERT_NE(nullptr, defaultDisplay);
|
||||
ScreenId screenId = defaultDisplay->GetScreenId();
|
||||
sptr<Screen> screen = ScreenManager::GetInstance().GetScreenById(screenId);
|
||||
ASSERT_NE(nullptr, screen);
|
||||
@@ -315,6 +319,7 @@ HWTEST_F(DisplayChangeTest, CheckDisplaySizeChange02, Function | MediumTest | Le
|
||||
WLOGFI("SetScreenActiveMode: %{public}u -> %{public}u", usedModeIdx, modeIdx);
|
||||
ASSERT_EQ(true, CheckDisplayChangeEventCallback(true));
|
||||
defaultDisplay = DisplayManager::GetInstance().GetDisplayById(defaultDisplayId_);
|
||||
ASSERT_NE(nullptr, defaultDisplay);
|
||||
ASSERT_EQ(true, DisplaySizeEqual(defaultDisplay, modes[modeIdx]));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,9 @@ void DisplayChangeUnitTest::SetUpTestCase()
|
||||
{
|
||||
defaultDisplayId_ = DisplayManager::GetInstance().GetDefaultDisplayId();
|
||||
sptr<Display> defaultDisplay = DisplayManager::GetInstance().GetDisplayById(defaultDisplayId_);
|
||||
defaultScreenId_ = defaultDisplay->GetScreenId();
|
||||
if (defaultDisplay != nullptr) {
|
||||
defaultScreenId_ = defaultDisplay->GetScreenId();
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayChangeUnitTest::TearDownTestCase()
|
||||
|
||||
@@ -330,7 +330,6 @@ NativeValue* JsWindowManager::OnMinimizeAll(NativeEngine& engine, NativeCallback
|
||||
WLOGFE("param is too small!");
|
||||
errCode = WMError::WM_ERROR_INVALID_PARAM;
|
||||
}
|
||||
// TODO: use DisplayId instead of int64_t when engine supported
|
||||
int64_t displayId = static_cast<int64_t>(DISPLAY_ID_INVALD);
|
||||
if (errCode == WMError::WM_OK && !ConvertFromJsValue(engine, info.argv[0], displayId)) {
|
||||
WLOGFE("Failed to convert parameter to displayId");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
@@ -214,7 +214,7 @@ ohos_static_library("wm_systemtest_common") {
|
||||
public_deps = [
|
||||
"//foundation/ace/ace_engine/interfaces/innerkits/ace:ace_uicontent",
|
||||
|
||||
# todo need delete it for abilitycontext
|
||||
# need delete it for abilitycontext
|
||||
"//foundation/ace/napi:ace_napi",
|
||||
"//foundation/graphic/standard/rosen/modules/render_service_client:librender_service_client",
|
||||
"//foundation/multimodalinput/input/frameworks/proxy:libmmi-client",
|
||||
|
||||
@@ -76,10 +76,9 @@ void WindowFocusTest::SetUpTestCase()
|
||||
if (display == nullptr) {
|
||||
WLOGFE("GetDefaultDisplay: failed!");
|
||||
return;
|
||||
} else {
|
||||
WLOGFI("GetDefaultDisplay: id %{public}" PRIu64", w %{public}d, h %{public}d, fps %{public}u",
|
||||
display->GetId(), display->GetWidth(), display->GetHeight(), display->GetFreshRate());
|
||||
}
|
||||
WLOGFI("GetDefaultDisplay: id %{public}" PRIu64", w %{public}d, h %{public}d, fps %{public}u",
|
||||
display->GetId(), display->GetWidth(), display->GetHeight(), display->GetFreshRate());
|
||||
Rect displayRect = {0, 0, display->GetWidth(), display->GetHeight()};
|
||||
utils::InitByDisplayRect(displayRect);
|
||||
}
|
||||
|
||||
@@ -163,10 +163,10 @@ void WindowImmersiveTest::SetUpTestCase()
|
||||
auto display = DisplayManager::GetInstance().GetDisplayById(0);
|
||||
if (display == nullptr) {
|
||||
WLOGFE("GetDefaultDisplay: failed!");
|
||||
} else {
|
||||
WLOGFI("GetDefaultDisplay: id %{public}" PRIu64", w %{public}d, h %{public}d, fps %{public}u",
|
||||
display->GetId(), display->GetWidth(), display->GetHeight(), display->GetFreshRate());
|
||||
return;
|
||||
}
|
||||
WLOGFI("GetDefaultDisplay: id %{public}" PRIu64", w %{public}d, h %{public}d, fps %{public}u",
|
||||
display->GetId(), display->GetWidth(), display->GetHeight(), display->GetFreshRate());
|
||||
Rect displayRect = {0, 0, display->GetWidth(), display->GetHeight()};
|
||||
utils::InitByDisplayRect(displayRect);
|
||||
}
|
||||
|
||||
@@ -38,10 +38,9 @@ void WindowInputMethodTest::SetUpTestCase()
|
||||
if (display == nullptr) {
|
||||
printf("GetDefaultDisplay: failed!\n");
|
||||
return;
|
||||
} else {
|
||||
printf("GetDefaultDisplay: id %llu, w %d, h %d, fps %u\n", display->GetId(), display->GetWidth(),
|
||||
display->GetHeight(), display->GetFreshRate());
|
||||
}
|
||||
printf("GetDefaultDisplay: id %llu, w %d, h %d, fps %u\n", display->GetId(), display->GetWidth(),
|
||||
display->GetHeight(), display->GetFreshRate());
|
||||
Rect displayRect = {0, 0, display->GetWidth(), display->GetHeight()};
|
||||
utils::InitByDisplayRect(displayRect);
|
||||
}
|
||||
|
||||
@@ -42,10 +42,10 @@ void WindowLayoutTest::SetUpTestCase()
|
||||
auto display = DisplayManager::GetInstance().GetDisplayById(0);
|
||||
if (display == nullptr) {
|
||||
printf("GetDefaultDisplay: failed!\n");
|
||||
} else {
|
||||
printf("GetDefaultDisplay: id %llu, w %d, h %d, fps %u\n", display->GetId(), display->GetWidth(),
|
||||
display->GetHeight(), display->GetFreshRate());
|
||||
return;
|
||||
}
|
||||
printf("GetDefaultDisplay: id %llu, w %d, h %d, fps %u\n", display->GetId(), display->GetWidth(),
|
||||
display->GetHeight(), display->GetFreshRate());
|
||||
Rect displayRect = {0, 0, display->GetWidth(), display->GetHeight()};
|
||||
utils::InitByDisplayRect(displayRect);
|
||||
|
||||
|
||||
@@ -78,10 +78,10 @@ void WindowMoveDragTest::SetUp()
|
||||
auto display = DisplayManager::GetInstance().GetDisplayById(0);
|
||||
if (display == nullptr) {
|
||||
WLOGFE("GetDefaultDisplay: failed!\n");
|
||||
} else {
|
||||
WLOGFI("GetDefaultDisplay: id %{public}llu, w %{public}d, h %{public}d, fps %{public}u\n",
|
||||
display->GetId(), display->GetWidth(), display->GetHeight(), display->GetFreshRate());
|
||||
return;
|
||||
}
|
||||
WLOGFI("GetDefaultDisplay: id %{public}llu, w %{public}d, h %{public}d, fps %{public}u\n",
|
||||
display->GetId(), display->GetWidth(), display->GetHeight(), display->GetFreshRate());
|
||||
Rect displayRect = {0, 0, display->GetWidth(), display->GetHeight()};
|
||||
utils::InitByDisplayRect(displayRect);
|
||||
|
||||
|
||||
@@ -275,10 +275,10 @@ void WindowTestUtils::InitSplitRects()
|
||||
auto display = DisplayManager::GetInstance().GetDisplayById(0);
|
||||
if (display == nullptr) {
|
||||
WLOGFE("GetDefaultDisplay: failed!");
|
||||
} else {
|
||||
WLOGFI("GetDefaultDisplay: id %{public}" PRIu64", w %{public}d, h %{public}d, fps %{public}u",
|
||||
display->GetId(), display->GetWidth(), display->GetHeight(), display->GetFreshRate());
|
||||
return;
|
||||
}
|
||||
WLOGFI("GetDefaultDisplay: id %{public}" PRIu64", w %{public}d, h %{public}d, fps %{public}u",
|
||||
display->GetId(), display->GetWidth(), display->GetHeight(), display->GetFreshRate());
|
||||
|
||||
Rect displayRect = {0, 0, display->GetWidth(), display->GetHeight()};
|
||||
displayRect_ = displayRect;
|
||||
|
||||
@@ -69,10 +69,10 @@ void WindowVisibilityInfoTest::SetUpTestCase()
|
||||
auto display = DisplayManager::GetInstance().GetDisplayById(0);
|
||||
if (display == nullptr) {
|
||||
WLOGFE("GetDefaultDisplay: failed!");
|
||||
} else {
|
||||
WLOGFI("GetDefaultDisplay: id %{public}" PRIu64", w %{public}d, h %{public}d, fps %{public}u",
|
||||
display->GetId(), display->GetWidth(), display->GetHeight(), display->GetFreshRate());
|
||||
return;
|
||||
}
|
||||
WLOGFI("GetDefaultDisplay: id %{public}" PRIu64", w %{public}d, h %{public}d, fps %{public}u",
|
||||
display->GetId(), display->GetWidth(), display->GetHeight(), display->GetFreshRate());
|
||||
Rect displayRect = {0, 0,
|
||||
static_cast<uint32_t>(display->GetWidth()), static_cast<uint32_t>(display->GetHeight())};
|
||||
utils::InitByDisplayRect(displayRect);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
||||
@@ -138,4 +138,4 @@ bool DragController::GetHitPoint(uint32_t windowId, PointInfo& point)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ WMError WindowNodeContainer::DestroyWindowNode(sptr<WindowNode>& node, std::vect
|
||||
|
||||
WMError WindowNodeContainer::RemoveWindowNode(sptr<WindowNode>& node)
|
||||
{
|
||||
if (node == nullptr || !node->surfaceNode_) {
|
||||
if (node == nullptr) {
|
||||
WLOGFE("window node or surface node is nullptr, invalid");
|
||||
return WMError::WM_ERROR_DESTROYED_OBJECT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user