| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" | 4 #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" |
| 5 | 5 |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/test/scoped_feature_list.h" | 7 #include "base/test/scoped_feature_list.h" |
| 8 #include "chrome/browser/safe_browsing/ui_manager.h" | 8 #include "chrome/browser/safe_browsing/ui_manager.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 InitializeRequest(LoginReputationClientRequest::UNFAMILIAR_LOGIN_PAGE); | 386 InitializeRequest(LoginReputationClientRequest::UNFAMILIAR_LOGIN_PAGE); |
| 387 InitializeVerdict(LoginReputationClientResponse::PHISHING); | 387 InitializeVerdict(LoginReputationClientResponse::PHISHING); |
| 388 | 388 |
| 389 security_interstitials::UnsafeResource resource; | 389 security_interstitials::UnsafeResource resource; |
| 390 EXPECT_CALL(*service_->ui_manager(), DisplayBlockingPage(testing::_)) | 390 EXPECT_CALL(*service_->ui_manager(), DisplayBlockingPage(testing::_)) |
| 391 .WillOnce(testing::SaveArg<0>(&resource)); | 391 .WillOnce(testing::SaveArg<0>(&resource)); |
| 392 RequestFinished(request_.get(), std::move(verdict_)); | 392 RequestFinished(request_.get(), std::move(verdict_)); |
| 393 EXPECT_EQ(GURL(kPhishingURL), resource.url); | 393 EXPECT_EQ(GURL(kPhishingURL), resource.url); |
| 394 EXPECT_EQ(GURL(kPhishingURL), resource.original_url); | 394 EXPECT_EQ(GURL(kPhishingURL), resource.original_url); |
| 395 EXPECT_FALSE(resource.is_subresource); | 395 EXPECT_FALSE(resource.is_subresource); |
| 396 EXPECT_EQ(SB_THREAT_TYPE_PASSWORD_PROTECTION_PHISHING_URL, | 396 EXPECT_EQ(SB_THREAT_TYPE_URL_PASSWORD_PROTECTION_PHISHING, |
| 397 resource.threat_type); | 397 resource.threat_type); |
| 398 EXPECT_EQ(ThreatSource::PASSWORD_PROTECTION_SERVICE, resource.threat_source); | 398 EXPECT_EQ(ThreatSource::PASSWORD_PROTECTION_SERVICE, resource.threat_source); |
| 399 EXPECT_EQ(web_contents(), resource.web_contents_getter.Run()); | 399 EXPECT_EQ(web_contents(), resource.web_contents_getter.Run()); |
| 400 | 400 |
| 401 content::BrowserThread::PostTask( | 401 content::BrowserThread::PostTask( |
| 402 content::BrowserThread::IO, FROM_HERE, | 402 content::BrowserThread::IO, FROM_HERE, |
| 403 base::BindOnce(&MockSafeBrowsingUIManager::InvokeOnBlockingPageComplete, | 403 base::BindOnce(&MockSafeBrowsingUIManager::InvokeOnBlockingPageComplete, |
| 404 service_->ui_manager(), resource.callback)); | 404 service_->ui_manager(), resource.callback)); |
| 405 } | 405 } |
| 406 | 406 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 434 InitializeVerdict(LoginReputationClientResponse::LOW_REPUTATION); | 434 InitializeVerdict(LoginReputationClientResponse::LOW_REPUTATION); |
| 435 RequestFinished(request_.get(), std::move(verdict_)); | 435 RequestFinished(request_.get(), std::move(verdict_)); |
| 436 | 436 |
| 437 // For protected password entry request, no interstitial shown if verdict is | 437 // For protected password entry request, no interstitial shown if verdict is |
| 438 // SAFE. | 438 // SAFE. |
| 439 InitializeVerdict(LoginReputationClientResponse::SAFE); | 439 InitializeVerdict(LoginReputationClientResponse::SAFE); |
| 440 RequestFinished(request_.get(), std::move(verdict_)); | 440 RequestFinished(request_.get(), std::move(verdict_)); |
| 441 } | 441 } |
| 442 | 442 |
| 443 } // namespace safe_browsing | 443 } // namespace safe_browsing |
| OLD | NEW |