Description[Android WebView] Filter out error page URL from onPageFinished to un-flake tests
The three tests being flaky (testContentUrlAccessWithTwoViews, testFileUrlAccessWithTwoViews and testCacheModeWithTwoViews) are all implicitly rely on the fact that when a page load error happens, onPageFinished is only called once. This behaviour had been broken since about M33, but due to happy timing, it just didn't cause the tests to fail.
The solution is to filter onPageFinished callbacks on AwContentsClient side, since the flow of passing the URL of the error page appears perfectly normal in the context of Chrome.
Other changes:
-- testContentUrlAccessWithTwoViews was in fact incorrect, as it wasn't expecting an error in case when access to content: URLs is blocked;
-- modified ClientOnPageFinishedTest.testOnPageFinishedCalledAfterError to catch situations when onPageFinished / onReceivedError is called twice, to avoid future regressions;
-- added ClientOnPageStartedTest to catch similar problems with onPageStarted.
BUG=370950, 371983
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=277787
Patch Set 1 #Patch Set 2 : Filter out the error page URL on the side of AwContentsClient #
Total comments: 2
Patch Set 3 : Fixed AwContentsTest#testEscapingOfErrorPage #
Total comments: 4
Patch Set 4 : Comments addressed #Patch Set 5 : Restore import of Runnable #Messages
Total messages: 21 (0 generated)
|