diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2017-03-20 11:19:26 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2017-03-23 16:43:07 +0000 |
commit | 7f00e90d3c4be2b023166e483c29a280960a35a4 (patch) | |
tree | 83a62c546a7c189f332a7a89e90d562354931331 /tests | |
parent | c5282c3479294f8d1c3ce310585aa9e3a8c4f4d7 (diff) |
Add QML test for "Fix search restart after zero entries"
The issue has been fixed in the qtwebengine-chromium 55-based branch:
2890c82cbd3a3e66d7062c9d9f4f065f5cc09d9e
This test is based on the corresponding chromium test:
https://codereview.chromium.org/2537773008/patch/1/10002
Change-Id: Ia930c42f2c3337f10fe133a35ffb5b596aa61d9f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
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) + } } } |