summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-07-24 10:40:08 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-07-24 10:40:08 +0200
commit5dd44f34a58b966ddc374d828b1979b9c689b1b5 (patch)
treec9beec83e2454bc7d001bdc116620b3cc323d7a4 /tests/auto/quick/qmltests
parent57363264cd0ff4b2f45f5344e18436fe419e2e95 (diff)
parentb73e4ce6f7cfe35a85b9a41e1a5ab36783e5edb0 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: src/3rdparty src/core/core_chromium.pri tests/auto/quick/qmltests/BLACKLIST tests/auto/quick/qquickwebengineview/BLACKLIST tests/auto/widgets/qwebenginepage/BLACKLIST tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp tests/auto/widgets/qwebengineview/BLACKLIST Change-Id: I11b26f5eebde29c4c62247b90e11e3ae40789fe4
Diffstat (limited to 'tests/auto/quick/qmltests')
-rw-r--r--tests/auto/quick/qmltests/BLACKLIST5
-rw-r--r--tests/auto/quick/qmltests/data/tst_findText.qml22
2 files changed, 17 insertions, 10 deletions
diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST
index 0a71e9f27..46bc65923 100644
--- a/tests/auto/quick/qmltests/BLACKLIST
+++ b/tests/auto/quick/qmltests/BLACKLIST
@@ -1,7 +1,2 @@
-[WebViewFindText::test_findTextInterruptedByLoad]
-linux
-qemu
-b2qt
-windows
[WebEngineViewSource::test_viewSourceURL]
*
diff --git a/tests/auto/quick/qmltests/data/tst_findText.qml b/tests/auto/quick/qmltests/data/tst_findText.qml
index 1ec574fae..14053a675 100644
--- a/tests/auto/quick/qmltests/data/tst_findText.qml
+++ b/tests/auto/quick/qmltests/data/tst_findText.qml
@@ -43,13 +43,21 @@ TestWebEngineView {
matchCount = -1
}
+ function findCallbackCalled() { return matchCount != -1 }
+
function findTextCallback(matchCount) {
+ // If this starts to fail then either clear was not called before findText
+ // or unexpected callback was triggered from some search.
+ // On c++ side callback id can be checked to verify
+ testcase.verify(!findCallbackCalled(), 'Unexpected callback call or uncleared state before findText call!')
+
webEngineView.matchCount = matchCount
findFailed = matchCount == 0
}
TestCase {
+ id: testcase
name: "WebViewFindText"
function getBodyInnerHTML() {
@@ -207,13 +215,17 @@ TestWebEngineView {
webEngineView.findText("hello", findFlags, webEngineView.findTextCallback);
// This should not crash.
- webEngineView.url = "https://www.qt.io";
- if (!webEngineView.waitForLoadSucceeded(12000))
- skip("Couldn't load page from network, skipping test.");
+ webEngineView.loadHtml("<html><body>New page with same hello text</body></html>")
+ verify(webEngineView.waitForLoadSucceeded())
// The callback is not supposed to be called, see QTBUG-61506.
- // Check whether the callback was called (-1 = no, other values = yes).
- tryVerify(function() { return webEngineView.matchCount == -1; }, 20000);
+ expectFailContinue('', 'No unexpected findText callback calls occurred.')
+ tryVerify(function() { return webEngineView.findCallbackCalled() })
+ verify(!webEngineView.findCallbackCalled())
+
+ webEngineView.clear();
+ webEngineView.findText('New page', findFlags, webEngineView.findTextCallback)
+ tryCompare(webEngineView, 'matchCount', 1)
}
}
}