summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2023-03-17 08:45:13 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-22 12:48:35 +0000
commit37b04eeb90063b9845d4b6154fa3bc7e36ebdf0c (patch)
treefe262622904dc25c9fb3ca3238997f1a6d00f250 /tests
parentb28b1cb6eca4752afd11d94af7d47d8afe91c424 (diff)
downloadqtwebengine-37b04eeb90063b9845d4b6154fa3bc7e36ebdf0c.tar.gz
Move widgets minimal example to manual tests
Task-number: QTBUG-108751 Change-Id: I6e237b04d1f6a19f64516cd45aabe4d28099abd5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 34ebe8be93ab10766d034e5a3943a12c8de3a58e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/CMakeLists.txt1
-rw-r--r--tests/manual/examples/CMakeLists.txt1
-rw-r--r--tests/manual/examples/widgets/CMakeLists.txt1
-rw-r--r--tests/manual/examples/widgets/minimal/CMakeLists.txt24
-rw-r--r--tests/manual/examples/widgets/minimal/main.cpp28
-rw-r--r--tests/manual/examples/widgets/minimal/minimal.pro8
6 files changed, 63 insertions, 0 deletions
diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt
index c6d3e6e50..4bb14e72d 100644
--- a/tests/manual/CMakeLists.txt
+++ b/tests/manual/CMakeLists.txt
@@ -1,2 +1,3 @@
+add_subdirectory(examples)
add_subdirectory(quick)
add_subdirectory(widgets)
diff --git a/tests/manual/examples/CMakeLists.txt b/tests/manual/examples/CMakeLists.txt
new file mode 100644
index 000000000..6e0b301ad
--- /dev/null
+++ b/tests/manual/examples/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(widgets)
diff --git a/tests/manual/examples/widgets/CMakeLists.txt b/tests/manual/examples/widgets/CMakeLists.txt
new file mode 100644
index 000000000..d853ba634
--- /dev/null
+++ b/tests/manual/examples/widgets/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(minimal)
diff --git a/tests/manual/examples/widgets/minimal/CMakeLists.txt b/tests/manual/examples/widgets/minimal/CMakeLists.txt
new file mode 100644
index 000000000..6351aaa90
--- /dev/null
+++ b/tests/manual/examples/widgets/minimal/CMakeLists.txt
@@ -0,0 +1,24 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(minimal LANGUAGES CXX)
+ find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+ endif()
+
+qt_internal_add_manual_test(minimal-widgets
+ SOURCES
+ main.cpp
+)
+
+set_target_properties(minimal-widgets PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(minimal-widgets PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
diff --git a/tests/manual/examples/widgets/minimal/main.cpp b/tests/manual/examples/widgets/minimal/main.cpp
new file mode 100644
index 000000000..86c04e721
--- /dev/null
+++ b/tests/manual/examples/widgets/minimal/main.cpp
@@ -0,0 +1,28 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QApplication>
+#include <QWebEngineView>
+
+QUrl commandLineUrlArgument()
+{
+ const QStringList args = QCoreApplication::arguments();
+ for (const QString &arg : args.mid(1)) {
+ if (!arg.startsWith(QLatin1Char('-')))
+ return QUrl::fromUserInput(arg);
+ }
+ return QUrl(QStringLiteral("https://www.qt.io"));
+}
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setOrganizationName("QtExamples");
+ QApplication app(argc, argv);
+
+ QWebEngineView view;
+ view.setUrl(commandLineUrlArgument());
+ view.resize(1024, 750);
+ view.show();
+
+ return app.exec();
+}
diff --git a/tests/manual/examples/widgets/minimal/minimal.pro b/tests/manual/examples/widgets/minimal/minimal.pro
new file mode 100644
index 000000000..849f4b9b6
--- /dev/null
+++ b/tests/manual/examples/widgets/minimal/minimal.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += webenginewidgets
+
+SOURCES += main.cpp
+
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/minimal
+INSTALLS += target