summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests/data/tst_mouseClick.qml
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2021-07-13 17:56:05 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2021-07-20 17:06:20 +0200
commit9c663f51c63f7661edcc604ce89171b3f037543d (patch)
tree402291f9e6e6cfccb814dd5a323c4b6de53e7a4a /tests/auto/quick/qmltests/data/tst_mouseClick.qml
parent4a81478a493f337b516af8995e0f41e79f15c33c (diff)
Get rid of Quick's TestSupport API
- Moved TestInputContext and TestInputEvent APIs to tst_qmltests. - Removed loadVisuallyCommitted and use Item.grabToImage to check if page is rendered. - Removed windowCloseRejected signal and use a hidden callback instead. Pick-to: 6.2 Change-Id: Ica6e4c6017426e0171d738a6a59afa557c786698 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'tests/auto/quick/qmltests/data/tst_mouseClick.qml')
-rw-r--r--tests/auto/quick/qmltests/data/tst_mouseClick.qml28
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_mouseClick.qml b/tests/auto/quick/qmltests/data/tst_mouseClick.qml
index 6c314d44c..647c84573 100644
--- a/tests/auto/quick/qmltests/data/tst_mouseClick.qml
+++ b/tests/auto/quick/qmltests/data/tst_mouseClick.qml
@@ -26,10 +26,10 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.4
-import QtWebEngine.testsupport 1.0
+import QtQuick
+import QtTest
+import QtWebEngine
+import Test.util
import "../../qmltests/data" 1.0
TestWebEngineView {
@@ -37,8 +37,10 @@ TestWebEngineView {
width: 200
height: 200
- testSupport: WebEngineTestSupport {
- function mouseMultiClick(item, x, y, clickCount) {
+ TestInputEvent {
+ id: testInputEvent
+
+ function __mouseMultiClick(item, x, y, clickCount) {
if (!item)
qtest_fail("No item given to mouseMultiClick", 1);
@@ -46,20 +48,20 @@ TestWebEngineView {
x = item.width / 2;
if (y === undefined)
y = item.height / 2;
- if (!testEvent.mouseMultiClick(item, x, y, clickCount))
+ if (!mouseMultiClick(item, x, y, clickCount))
qtest_fail("window not shown", 2);
}
function mouseDoubleClick(item, x, y) {
- mouseMultiClick(item, x, y, 2);
+ __mouseMultiClick(item, x, y, 2);
}
function mouseTripleClick(item, x, y) {
- mouseMultiClick(item, x, y, 3);
+ __mouseMultiClick(item, x, y, 3);
}
function mouseQuadraClick(item, x, y) {
- mouseMultiClick(item, x, y, 4);
+ __mouseMultiClick(item, x, y, 4);
}
}
@@ -91,7 +93,7 @@ TestWebEngineView {
verify(webEngineView.waitForLoadSucceeded());
var center = getElementCenter("input");
- webEngineView.testSupport.mouseDoubleClick(webEngineView, center.x, center.y);
+ testInputEvent.mouseDoubleClick(webEngineView, center.x, center.y);
verifyElementHasFocus("input");
tryVerify(function() { return getTextSelection() == "Company" });
@@ -107,7 +109,7 @@ TestWebEngineView {
verify(webEngineView.waitForLoadSucceeded());
var center = getElementCenter("input");
- webEngineView.testSupport.mouseTripleClick(webEngineView, center.x, center.y);
+ testInputEvent.mouseTripleClick(webEngineView, center.x, center.y);
verifyElementHasFocus("input");
tryVerify(function() { return getTextSelection() == "The Qt Company" });
@@ -123,7 +125,7 @@ TestWebEngineView {
verify(webEngineView.waitForLoadSucceeded());
var center = getElementCenter("input");
- webEngineView.testSupport.mouseQuadraClick(webEngineView, center.x, center.y);
+ testInputEvent.mouseQuadraClick(webEngineView, center.x, center.y);
verifyElementHasFocus("input");
tryVerify(function() { return getTextSelection() == "" });
}