Use ERR_ABORTED when SB committed interstitial is not shown
With Committed interstitials, ERR_BLOCKED_BY_CLIENT is used instead of
ERR_ABORTED when cancelling a safe browsing flagged navigation. This
causes an issue when an interstitial is not shown, triggering a net
error page. This changes the code back to ERR_ABORTED when no
interstitial is shown. The plumbing to the URLLoaderThrottles was
also setting showed_interstitial to true in some cases where it should
be false. This CL also fixes that.
Bug: 1022477, 1045549
Test: This fixes a CTS test that was broken with committed interstitials
(android.webkit.cts.WebViewClientTest#testOnSafeBrowsingHit)
Change-Id: I8f10bea767749919e4a5ef6b460c9b96d6cbb75f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2008310
Commit-Queue: Carlos IL <[email protected]>
Reviewed-by: Nathan Parker <[email protected]>
Reviewed-by: Tao Bai <[email protected]>
Reviewed-by: Tim Volodine <[email protected]>
Cr-Commit-Position: refs/heads/master@{#735690}
diff --git a/chrome/browser/safe_browsing/ui_manager_unittest.cc b/chrome/browser/safe_browsing/ui_manager_unittest.cc
index 56fa6c2..01ad03e 100644
--- a/chrome/browser/safe_browsing/ui_manager_unittest.cc
+++ b/chrome/browser/safe_browsing/ui_manager_unittest.cc
@@ -52,19 +52,19 @@
bool callback_called() const { return callback_called_; }
bool proceed() const { return proceed_; }
- void OnBlockingPageDone(bool proceed) {
+ void OnBlockingPageDone(bool proceed, bool showed_interstitial) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
callback_called_ = true;
proceed_ = proceed;
loop_.Quit();
}
- void OnBlockingPageDoneOnIO(bool proceed) {
+ void OnBlockingPageDoneOnIO(bool proceed, bool showed_interstitial) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
base::PostTask(
FROM_HERE, {BrowserThread::UI},
base::BindOnce(&SafeBrowsingCallbackWaiter::OnBlockingPageDone,
- base::Unretained(this), proceed));
+ base::Unretained(this), proceed, showed_interstitial));
}
void WaitForCallback() {
@@ -163,7 +163,8 @@
main_frame_url = entry->GetURL();
ui_manager_->OnBlockingPageDone(resources, proceed, web_contents(),
- main_frame_url);
+ main_frame_url,
+ true /* showed_interstitial */);
}
protected: