Description[Android WebView] Fire onPageFinished from WebContentsObserver::didStopLoading
After CL https://codereview.chromium.org/1381003004,
WebContentsObserver::didStopLoading has become the last event fired
when loading is finished.
WebView was using WebContentsObserver::didFinishLoad event
when it is fired for the main frame, but this callback now happens
before WebContentsImpl has updated its internal state. This causes
subtle race issues, e.g. unwanted reloading of the currently
loading page due to UA string update, which caused flakiness of
AwSettingsTest#testUserAgentStringOverrideForHistory test.
However, as didStopLoading is fired in some cases when didFinishLoad
isn't, we still need to use didFinishLoad to gate posting of
onPageFinishedEvent.
BUG=553762
Committed: https://crrev.com/8f1314f6d90ebcc24506cd036e76f98c3881e8ba
Cr-Commit-Position: refs/heads/master@{#359642}
Patch Set 1 #Patch Set 2 : Post callback from didStopLoading only if had didFinishLoad before #Patch Set 3 : Fix loadDataWithBaseUrl case #Patch Set 4 : Fixed AwWebContentsObserverTest#testOnPageFinished #
Total comments: 6
Patch Set 5 : Comments addressed #Patch Set 6 : Update WebContentsObserverProxy for extracting base url in both cases #Patch Set 7 : Restore required AwWebContentsObserverTest changes #
Messages
Total messages: 19 (9 generated)
|