Commit f5bea1f4 authored by paulmeyer's avatar paulmeyer Committed by Commit bot

Fix for flaky WebViewTest.Shim_TestFindAPI_findupdate test on msan bots.

Part of what this test tests is canceling an in-progress find session by
searching for another search term. The problem that was causing the
flakiness was that the find session that was meant to get canceled
actually finished (rarely) before the subsequent request made it to the
renderer, and so the completed session was not reported as canceled. The
small adjustment made in this CL is to only attempt to cancel the search
that has many results, so that its find session is much less likely to
complete before the next find request comes through.

BUG=710486

Review-Url: https://codereview.chromium.org/2857953004
Cr-Commit-Position: refs/heads/master@{#469390}
parent 5b970b53
...@@ -2665,6 +2665,8 @@ function testFindAPI() { ...@@ -2665,6 +2665,8 @@ function testFindAPI() {
document.body.appendChild(webview); document.body.appendChild(webview);
}; };
// TODO(paulmeyer): Make sure this test is not still flaky. If it is, it is
// likely because the search for "dog" compelted too quickly. crbug.com/710486.
function testFindAPI_findupdate() { function testFindAPI_findupdate() {
var webview = new WebView(); var webview = new WebView();
webview.src = testFindPage; webview.src = testFindPage;
...@@ -2683,8 +2685,8 @@ function testFindAPI_findupdate() { ...@@ -2683,8 +2685,8 @@ function testFindAPI_findupdate() {
if (e.canceled) { if (e.canceled) {
canceledTest = true; canceledTest = true;
} else { } else {
embedder.test.assertEq(e.searchText, "dog"); embedder.test.assertEq(e.searchText, "cat");
embedder.test.assertEq(e.numberOfMatches, 100); embedder.test.assertEq(e.numberOfMatches, 10);
embedder.test.assertEq(e.activeMatchOrdinal, 1); embedder.test.assertEq(e.activeMatchOrdinal, 1);
embedder.test.assertTrue(canceledTest); embedder.test.assertTrue(canceledTest);
embedder.test.succeed(); embedder.test.succeed();
...@@ -2692,8 +2694,8 @@ function testFindAPI_findupdate() { ...@@ -2692,8 +2694,8 @@ function testFindAPI_findupdate() {
} }
}); });
webview.find("dog"); webview.find("dog");
webview.find("cat");
webview.find("dog"); webview.find("dog");
webview.find("cat");
}); });
document.body.appendChild(webview); document.body.appendChild(webview);
......
Markdown is supported
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