From 528bad22fa0cdb96b8de9de4af33981ff1750fe6 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Fri, 14 Oct 2016 17:13:59 +0200
Subject: [PATCH] Fix find after navigation

Update Chromium for the actual fix. Add quick auto test for the issue
and unskip WebViewFindText::testfindTextManyMatches.

Task-number: QTBUG-56373
Change-Id: Id70291e5231f572c85b0a7c1ec1b6facd161115a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
---
 src/3rdparty                                  |  2 +-
 tests/auto/quick/qmltests/BLACKLIST           |  3 ---
 .../auto/quick/qmltests/data/tst_findText.qml | 19 +++++++++++++++++++
 tests/auto/quick/qmltests/qmltests.pro        |  1 +
 4 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/src/3rdparty b/src/3rdparty
index 600b27325..f3ce802c7 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit 600b273256015db194640549e57199cef6e07902
+Subproject commit f3ce802c71aeaeb7dd218180a3bc5c6ac63b445d
diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST
index 375d89894..0d48724de 100644
--- a/tests/auto/quick/qmltests/BLACKLIST
+++ b/tests/auto/quick/qmltests/BLACKLIST
@@ -12,6 +12,3 @@ osx
 
 [WebEngineViewLoadUrl::test_urlProperty]
 windows
-
-[WebViewFindText::test_findTextManyMatches]
-*
diff --git a/tests/auto/quick/qmltests/data/tst_findText.qml b/tests/auto/quick/qmltests/data/tst_findText.qml
index 904a8feb2..4761513c1 100644
--- a/tests/auto/quick/qmltests/data/tst_findText.qml
+++ b/tests/auto/quick/qmltests/data/tst_findText.qml
@@ -107,5 +107,24 @@ TestWebEngineView {
             tryCompare(webEngineView, "matchCount", 0)
             verify(findFailed)
         }
+
+        function test_findTextAfterNotFound() {
+            var findFlags = 0
+            webEngineView.url = Qt.resolvedUrl("about:blank")
+            verify(webEngineView.waitForLoadSucceeded())
+
+            webEngineView.clear()
+            webEngineView.findText("hello", findFlags, webEngineView.findTextCallback)
+            tryCompare(webEngineView, "matchCount", 0)
+            verify(findFailed)
+
+            webEngineView.url = Qt.resolvedUrl("test1.html")
+            verify(webEngineView.waitForLoadSucceeded())
+
+            webEngineView.clear()
+            webEngineView.findText("hello", findFlags, webEngineView.findTextCallback)
+            tryCompare(webEngineView, "matchCount", 1)
+            verify(!findFailed)
+        }
     }
 }
diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro
index cc5434807..726519db2 100644
--- a/tests/auto/quick/qmltests/qmltests.pro
+++ b/tests/auto/quick/qmltests/qmltests.pro
@@ -45,6 +45,7 @@ OTHER_FILES += \
     $$PWD/data/tst_favicon.qml \
     $$PWD/data/tst_faviconDownload.qml \
     $$PWD/data/tst_filePicker.qml \
+    $$PWD/data/tst_findText.qml \
     $$PWD/data/tst_focusOnNavigation.qml \
     $$PWD/data/tst_formValidation.qml \
     $$PWD/data/tst_geopermission.qml \
-- 
GitLab