Deflake SSLUIWorkerFetchTest.MixedContentSettings*

This re-enables and deflakes the MixedContentSettings* tests by having
RunMixedContentSettingsTest() create a new tab for each invocation.
Previously, the SSLStatus::RAN_INSECURE_CONTENT bit was being retained
when subsequent invocations caused the navigations to commit to the same
previously used process (|SSLHostStateDelegate| tracks per-host/process
and is used to populate the SSLStatus on new navigations) -- essentially
once insecure content is run in the process we consider it tainted. This
behavior is currently working-as-intended but we are considering
followup changes in

The fix to deflake the test is as follows:
1) Have each invocation of RunMixedContentSettingsTest() run in a new tab
(creating and tearing down the tab in each invocation). This forces new
RenderFrames/processes to be used.
2) Ensure the WebkitPreferences are correctly set by calling
RenderViewHost::OnWebkitPreferencesChanged() (this matches the behavior
for similar tests that apply overrides like
ServiceWorkerVersionBrowserTest.FetchWithSaveData [1]).
3) Check the security state based on the visible navigation entry rather
than the last committed entry, which matches how |VisibleSecurityState|
is calculated and used for displaying security state information about
a tab.


Bug: 890372
Change-Id: Ic89ffb31ae0e97420c0cefe3ade2db8128ad26bd
Reviewed-by: Emily Stark <>
Commit-Queue: Christopher Thompson <>
Cr-Commit-Position: refs/heads/master@{#654138}
2 files changed