diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_findText.qml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_findText.qml b/tests/auto/quick/qmltests/data/tst_findText.qml index 4761513c1..78359bfc2 100644 --- a/tests/auto/quick/qmltests/data/tst_findText.qml +++ b/tests/auto/quick/qmltests/data/tst_findText.qml @@ -52,6 +52,15 @@ TestWebEngineView { TestCase { name: "WebViewFindText" + function getBodyInnerHTML() { + var bodyInnerHTML; + runJavaScript("document.body.innerHTML", function(result) { + bodyInnerHTML = result; + }); + tryVerify(function() { return bodyInnerHTML != undefined; }); + return bodyInnerHTML; + } + function test_findText() { var findFlags = WebEngineView.FindCaseSensitively webEngineView.url = Qt.resolvedUrl("test1.html") @@ -126,5 +135,27 @@ TestWebEngineView { tryCompare(webEngineView, "matchCount", 1) verify(!findFailed) } + + function test_findTextInModifiedDOMAfterNotFound() { + var findFlags = 0 + webEngineView.loadHtml( + "<html><body>" + + "bla" + + "</body></html>"); + verify(webEngineView.waitForLoadSucceeded()) + + webEngineView.clear() + webEngineView.findText("hello", findFlags, webEngineView.findTextCallback) + tryCompare(webEngineView, "matchCount", 0) + verify(findFailed) + + runJavaScript("document.body.innerHTML = 'blahellobla'"); + tryVerify(function() { return getBodyInnerHTML() == "blahellobla"; }); + + webEngineView.clear() + webEngineView.findText("hello", findFlags, webEngineView.findTextCallback) + tryCompare(webEngineView, "matchCount", 1) + verify(!findFailed) + } } } |