diff options
author | Michal Klocek <michal.klocek@qt.io> | 2021-02-11 10:03:24 +0100 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2021-05-22 14:10:10 +0200 |
commit | 97dcbd4019456b9a1c567faddb0521b7505d80fc (patch) | |
tree | 9c77c5640b1563d853c79898cd64d87252fe8c41 /tests/auto/quick/qquickwebengineview | |
parent | dd523573f2981cc58d4da0ec6e2b061a6172a8eb (diff) |
Add tests to the cmake build
Use QT_TESTCASE_SOURCEDIR instead of TESTS_SOURCE_DIR.
Introduce Test::HttpServer and Test::Util targets.
Query shared data location from server.
Clean up "shared" resources.
Note QT_TESTCASE_SOURCEDIR must be turned into the canonical form
since the user can call on windows:
"cmake \path\to\foo" instead of "cmake c:\path\to\foo" which
will break all file:// urls.
Note this patch breaks qmake builds.
Task-number: QTBUG-91760
Change-Id: Ibc1f904ac9acd375d1ff70ff80f0c533497e3f20
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickwebengineview')
8 files changed, 129 insertions, 2 deletions
diff --git a/tests/auto/quick/qquickwebengineview/CMakeLists.txt b/tests/auto/quick/qquickwebengineview/CMakeLists.txt new file mode 100644 index 000000000..45c44034a --- /dev/null +++ b/tests/auto/quick/qquickwebengineview/CMakeLists.txt @@ -0,0 +1,13 @@ +include(../../util/util.cmake) + +qt_internal_add_test(tst_qquickwebengineview + SOURCES + tst_qquickwebengineview.cpp + LIBRARIES + Qt::WebEngineCorePrivate + Qt::WebEngineWidgets + Qt::WebEngineQuick + Qt::GuiPrivate + Qt::WebEngineQuickPrivate + Test::Util +) diff --git a/tests/auto/quick/qquickwebengineview/html/basic_page.html b/tests/auto/quick/qquickwebengineview/html/basic_page.html new file mode 100644 index 000000000..53726e4a6 --- /dev/null +++ b/tests/auto/quick/qquickwebengineview/html/basic_page.html @@ -0,0 +1,6 @@ +<html> +<head> +<title> Basic Page </title> +</head> +<h1>Basic page</h1> +</html> diff --git a/tests/auto/quick/qquickwebengineview/html/basic_page2.html b/tests/auto/quick/qquickwebengineview/html/basic_page2.html new file mode 100644 index 000000000..f8cff2969 --- /dev/null +++ b/tests/auto/quick/qquickwebengineview/html/basic_page2.html @@ -0,0 +1 @@ +<h1>Basic page 2</h1> diff --git a/tests/auto/quick/qquickwebengineview/html/direct-image-compositing.html b/tests/auto/quick/qquickwebengineview/html/direct-image-compositing.html new file mode 100644 index 000000000..53a4ca137 --- /dev/null +++ b/tests/auto/quick/qquickwebengineview/html/direct-image-compositing.html @@ -0,0 +1,66 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> + +<html lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title>Testing direct image layer optimization</title> + <style type="text/css" media="screen"> + img { + float: left; + width: 150px; + height: 150px; + } + img { + -webkit-transform: rotate3d(0, 0, 1, 0); + } + .test { + float: left; + height: 200px; + width: 260px; + } + </style> +</head> +<body> + + <h1>Image optimization in layers</h1> + + <p> + This test exercises direct compositing of images with hardware acceleration. The visual results + using ACCELERATED_COMPOSITING and regular TOT should be identical. Running this test manually with + the correct debug options will show which elements are directly composited. See + <a href="https://bugs.webkit.org/show_bug.cgi?id=23361">https://bugs.webkit.org/show_bug.cgi?id=23361</a> + </p> + + <div class="test"> + <img src="resources/simple_image.png"> + Basic image - no style - can be directly composited + </div> + + <div class="test"> + <img src="resources/simple_image.png" style="border: 5px solid blue;"> + 5px blue border - can NOT be directly composited + </div> + + <div class="test"> + <img src="resources/simple_image.png" style="margin: 5px 5px;"> + margin - can NOT be directly composited + </div> + + <div class="test"> + <img src="resources/simple_image.png" style="background-color: grey;"> + solid background - can be directly composited + </div> + + <div class="test"> + <img src="resources/simple_image.png" style="background: orange url(resources/simple_image.png) -50px -50px;"> + background image - can NOT be directly composited + </div> + + <div class="test"> + <img src="resources/simple_image.png" style="-webkit-transform: rotate3d(0, 0, 1, 10deg);"> + rotated but otherwise no style - can be directly composited + </div> + +</body> +</html> diff --git a/tests/auto/quick/qquickwebengineview/html/inputmethod.html b/tests/auto/quick/qquickwebengineview/html/inputmethod.html new file mode 100644 index 000000000..dc9140f9d --- /dev/null +++ b/tests/auto/quick/qquickwebengineview/html/inputmethod.html @@ -0,0 +1,11 @@ +<html> +<head> +<title>Basic Page For Input Method Testing</title> +</head> +<body> +<h1>Basic page</h1> +<input id="inputField" /> +<input id="emailInputField" type="email" /> +<div id="editableDiv" contenteditable></div> +</body> +</html> diff --git a/tests/auto/quick/qquickwebengineview/html/resources/simple_image.png b/tests/auto/quick/qquickwebengineview/html/resources/simple_image.png Binary files differnew file mode 100644 index 000000000..4685399ca --- /dev/null +++ b/tests/auto/quick/qquickwebengineview/html/resources/simple_image.png diff --git a/tests/auto/quick/qquickwebengineview/html/scroll.html b/tests/auto/quick/qquickwebengineview/html/scroll.html new file mode 100644 index 000000000..ce2193b6c --- /dev/null +++ b/tests/auto/quick/qquickwebengineview/html/scroll.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<html> +<meta name="viewport" content="width=200, height=500, user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1"/> +<script type="text/javascript"> +function pageScroll() { + window.scrollBy(0,50); // horizontal and vertical scroll increments +} +</script> +<style> + body { + background-color: blue; + margin: 50 50 50 50; + } + div { + font-color: white; + background-color: green; + width: 300px; + height: 1000px; + } +</style> + +<head> +<title>Scroll test </title> +</head> +<body onload="pageScroll()"> +<div> +</div> +</body> +</html> diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp index 30441ac11..d0df5ffe0 100644 --- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp +++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp @@ -27,7 +27,7 @@ ****************************************************************************/ #include "testwindow.h" -#include "util.h" +#include "quickutil.h" #include <QScopedPointer> #include <QtCore/qelapsedtimer.h> @@ -111,7 +111,7 @@ tst_QQuickWebEngineView::tst_QQuickWebEngineView() QtWebEngine::initialize(); QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true); - m_testSourceDirPath = QString::fromLocal8Bit(TESTS_SOURCE_DIR); + m_testSourceDirPath = QDir(QT_TESTCASE_SOURCEDIR).canonicalPath(); if (!m_testSourceDirPath.endsWith(QLatin1Char('/'))) m_testSourceDirPath.append(QLatin1Char('/')); @@ -1252,3 +1252,4 @@ static QByteArrayList params = QByteArrayList() W_QTEST_MAIN(tst_QQuickWebEngineView, params) #include "tst_qquickwebengineview.moc" +#include "moc_quickutil.cpp" |