Commit 7f00e90d authored by Peter Varga's avatar Peter Varga
Browse files

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: default avatarAllan Sandfeld Jensen <allan.jensen@qt.io>
parent c5282c34
No related merge requests found
Showing with 31 additions and 0 deletions
...@@ -52,6 +52,15 @@ TestWebEngineView { ...@@ -52,6 +52,15 @@ TestWebEngineView {
TestCase { TestCase {
name: "WebViewFindText" name: "WebViewFindText"
function getBodyInnerHTML() {
var bodyInnerHTML;
runJavaScript("document.body.innerHTML", function(result) {
bodyInnerHTML = result;
});
tryVerify(function() { return bodyInnerHTML != undefined; });
return bodyInnerHTML;
}
function test_findText() { function test_findText() {
var findFlags = WebEngineView.FindCaseSensitively var findFlags = WebEngineView.FindCaseSensitively
webEngineView.url = Qt.resolvedUrl("test1.html") webEngineView.url = Qt.resolvedUrl("test1.html")
...@@ -126,5 +135,27 @@ TestWebEngineView { ...@@ -126,5 +135,27 @@ TestWebEngineView {
tryCompare(webEngineView, "matchCount", 1) tryCompare(webEngineView, "matchCount", 1)
verify(!findFailed) 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)
}
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment