summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brüning <michael.bruning@qt.io>2023-05-16 18:30:06 +0200
committerMichael Brüning <michael.bruning@qt.io>2023-05-17 03:22:14 +0000
commit0aded4662dfab4b213b81e08998b2538a8c8dd0f (patch)
treece7e4941678d29b2c5d619641050efebe04340c7
parent6d8617742f179b09631653a9d2fc4da8be876a54 (diff)
downloadqtwebengine-0aded4662dfab4b213b81e08998b2538a8c8dd0f.tar.gz
Assert that the primary screen is available before using it
Does not fix the underlying issue, but may give us more meaningful information about the seemingly random crashes we have seen on the CI. Change-Id: I239fd05bf6a7add38e17830aad59f961036871d9 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index ba88fd99e..9c6a7ca2d 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -1359,6 +1359,7 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterMove_data()
void tst_QWebEnginePage::comboBoxPopupPositionAfterMove()
{
QWebEngineView view;
+ Q_ASSERT(QGuiApplication::primaryScreen());
view.move(QGuiApplication::primaryScreen()->availableGeometry().topLeft());
view.resize(640, 480);
view.show();
@@ -1430,6 +1431,7 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove()
mainWidget.layout()->addWidget(&view);
QScreen *screen = QGuiApplication::primaryScreen();
+ Q_ASSERT(screen);
mainWidget.move(screen->availableGeometry().topLeft());
mainWidget.resize(640, 480);
mainWidget.show();