Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3161)

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc

Issue 2669833004: Refactor subresource filter activation to support PlzNavigate cleanly. (Closed)
Patch Set: Rebase. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
index 40f5ef41cbf6151770b33ab464209b1c20669497..84df79611137bcaf9905894fefa08ad086b99f8b 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
@@ -112,8 +112,8 @@ class MockSubresourceFilterDriver
~MockSubresourceFilterDriver() override = default;
- MOCK_METHOD3(ActivateForProvisionalLoad,
- void(subresource_filter::ActivationLevel, const GURL&, bool));
+ MOCK_METHOD2(ActivateForNextCommittedLoad,
+ void(subresource_filter::ActivationLevel, bool));
private:
DISALLOW_COPY_AND_ASSIGN(MockSubresourceFilterDriver);
@@ -954,12 +954,12 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest,
SetupResponseForUrl(bad_url, malware_full_hash);
WebContents* main_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
+ browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_CALL(observer_, OnSafeBrowsingHit(IsUnsafeResourceFor(bad_url)))
.Times(1);
- EXPECT_CALL(*driver(), ActivateForProvisionalLoad(::testing::_, ::testing::_,
- ::testing::_))
+ EXPECT_CALL(*driver(),
+ ActivateForNextCommittedLoad(::testing::_, ::testing::_))
.Times(0);
ui_test_utils::NavigateToURL(browser(), bad_url);
Mock::VerifyAndClearExpectations(&observer_);
@@ -968,8 +968,8 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest,
content::WaitForInterstitialAttach(main_contents);
EXPECT_TRUE(ShowingInterstitialPage());
testing::Mock::VerifyAndClearExpectations(driver());
- EXPECT_CALL(*driver(), ActivateForProvisionalLoad(::testing::_, ::testing::_,
- ::testing::_))
+ EXPECT_CALL(*driver(),
+ ActivateForNextCommittedLoad(::testing::_, ::testing::_))
.Times(1);
InterstitialPage* interstitial_page = main_contents->GetInterstitialPage();
ASSERT_TRUE(interstitial_page);
@@ -996,12 +996,12 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, SocEngReportingBlacklistEmpty) {
SetupResponseForUrl(bad_url, malware_full_hash);
WebContents* main_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
+ browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_CALL(observer_, OnSafeBrowsingHit(IsUnsafeResourceFor(bad_url)))
.Times(1);
- EXPECT_CALL(*driver(), ActivateForProvisionalLoad(::testing::_, ::testing::_,
- ::testing::_))
+ EXPECT_CALL(*driver(),
+ ActivateForNextCommittedLoad(::testing::_, ::testing::_))
.Times(0);
ui_test_utils::NavigateToURL(browser(), bad_url);
testing::Mock::VerifyAndClearExpectations(driver());
@@ -1010,8 +1010,8 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, SocEngReportingBlacklistEmpty) {
content::WaitForInterstitialAttach(main_contents);
EXPECT_TRUE(ShowingInterstitialPage());
testing::Mock::VerifyAndClearExpectations(driver());
- EXPECT_CALL(*driver(), ActivateForProvisionalLoad(::testing::_, ::testing::_,
- ::testing::_))
+ EXPECT_CALL(*driver(),
+ ActivateForNextCommittedLoad(::testing::_, ::testing::_))
.Times(0);
InterstitialPage* interstitial_page = main_contents->GetInterstitialPage();
ASSERT_TRUE(interstitial_page);

Powered by Google App Engine
This is Rietveld 408576698