This is a reland of commit c52ea2979e
The original CL was reverted in https://crrev.com/c/5528858 because the
DontContainPrerenderingInfoInThreatReport test was failing on Chrome
bots. This was caused by test setup, and this CL fixes that.
That test had been added in https://crrev.com/c/2948322 to confirm
that prerender URLs are not attached to CSBRRs logged for the main
frame. It was simulating this scenario with a client-side phishing
warning that was determined pre-commit due to the test setup, and it
would still trigger attaching URLs from the DOM in the CSBRR since
client-side phishing warnings always returned false for the function
IsMainPageLoadBlocked. This test setup of a client-side phishing warning
being determined pre-commit is not possible in production code, and
stopped working with async checks being enabled because
IsMainPageLoadBlocked (now called IsMainPageLoadPending) is no longer
hard-coded to return false for client-side phishing warnings.
This CL replaces that test with a version that instead uses a post-
commit async check to confirm that prerender URLs are not attached,
since that is possible in production code. I have confirmed that undoing
the threat_details.cc crrev.com/c/2948322 fix causes the new test to
fail as well.
This CL also involves some refactoring for the new test:
- SBBPAsyncChecksTimingTest and SBBPAsyncChecksPrerenderingTest inherit
from SBBPAsyncChecksTimingTestBase. Only SBBPAsyncChecksTimingTest
extends WithParamInterface<bool> as well to test both true and false
for check_complete_after_navigation_finish. The split is done because
the new test within SBBPAsyncChecksPrerenderingTest does not use this
parameter.
- A new SBBPAsyncChecksTestBase base class is introduced that
SBBPAsyncChecksTest and SBBPAsyncChecksTimingTestBase inherit from.
Only SBBPAsyncChecksTest extends WithParamInterface<bool> as well to
test async checks enabled and disabled. SBBPAsyncChecksTimingTest was
previously overriding the feature list to enable async checks, and
used the param for check_complete_after_navigation_finish instead.
Original change's description:
> Enable SafeBrowsingAsyncRealTimeCheck by default on Desktop
>
> Bug: 40941453
> Change-Id: Ia89befcdcce75f39aa11ec9f87754b86ba371afe
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5522265
> Reviewed-by: Varun Khaneja <vakh@chromium.org>
> Commit-Queue: Varun Khaneja <vakh@chromium.org>
> Auto-Submit: thefrog <thefrog@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1298313}
Bug: 40941453
Change-Id: I21573d3ee95e4465d401b304d61794e319f95043
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539814
Reviewed-by: Xinghui Lu <xinghuilu@chromium.org>
Commit-Queue: thefrog <thefrog@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301593}