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

Unified Diff: chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc

Issue 7408001: If we show a SafeBrowsing warning we always send the client-side detection (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge Created 9 years, 5 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
« no previous file with comments | « chrome/renderer/safe_browsing/phishing_classifier_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc
diff --git a/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc b/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc
index c50cb65c276a3decdaddeca703ba4cf39236b03f..e3053d8421d9a2575235d148cbd9a98c8531cef0 100644
--- a/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc
+++ b/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc
@@ -64,15 +64,15 @@ class PhishingClassifierDelegateTest : public RenderViewFakeResourcesTest {
bool OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PhishingClassifierDelegateTest, message)
- IPC_MESSAGE_HANDLER(SafeBrowsingHostMsg_DetectedPhishingSite,
- OnDetectedPhishingSite)
+ IPC_MESSAGE_HANDLER(SafeBrowsingHostMsg_PhishingDetectionDone,
+ OnPhishingDetectionDone)
IPC_MESSAGE_UNHANDLED(
handled = RenderViewFakeResourcesTest::OnMessageReceived(message))
IPC_END_MESSAGE_MAP()
return handled;
}
- void OnDetectedPhishingSite(const std::string& verdict_str) {
+ void OnPhishingDetectionDone(const std::string& verdict_str) {
scoped_ptr<ClientPhishingRequest> verdict(new ClientPhishingRequest);
if (verdict->ParseFromString(verdict_str) &&
verdict->IsInitialized()) {
@@ -82,7 +82,7 @@ class PhishingClassifierDelegateTest : public RenderViewFakeResourcesTest {
}
// Runs the ClassificationDone callback, then waits for the
- // DetectedPhishingSite IPC to arrive.
+ // PhishingDetectionDone IPC to arrive.
void RunClassificationDone(PhishingClassifierDelegate* delegate,
const ClientPhishingRequest& verdict) {
// Clear out any previous state.
@@ -439,9 +439,9 @@ TEST_F(PhishingClassifierDelegateTest, DuplicatePageCapture) {
EXPECT_CALL(*classifier, CancelPendingClassification());
}
-TEST_F(PhishingClassifierDelegateTest, DetectedPhishingSite) {
- // Tests that a DetectedPhishingSite IPC is sent to the browser
- // if a site comes back as phishy.
+TEST_F(PhishingClassifierDelegateTest, PhishingDetectionDone) {
+ // Tests that a PhishingDetectionDone IPC is sent to the browser
+ // whenever we finish classification.
MockPhishingClassifier* classifier =
new StrictMock<MockPhishingClassifier>(view_);
PhishingClassifierDelegate* delegate =
@@ -470,7 +470,7 @@ TEST_F(PhishingClassifierDelegateTest, DetectedPhishingSite) {
ClientPhishingRequest verdict;
verdict.set_url("http://host.com/#a");
verdict.set_client_score(0.8f);
- verdict.set_is_phishing(true);
+ verdict.set_is_phishing(false); // Send IPC even if site is not phishing.
RunClassificationDone(delegate, verdict);
ASSERT_TRUE(verdict_.get());
EXPECT_EQ(verdict.SerializeAsString(), verdict_->SerializeAsString());
« no previous file with comments | « chrome/renderer/safe_browsing/phishing_classifier_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698