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

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

Issue 8310014: Only send the client-side phishing model to a renderer if its profile has SafeBrowsing enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a comment as Noe suggested Created 9 years, 2 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/renderer/safe_browsing/phishing_classifier_browsertest.cc
diff --git a/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc b/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc
index 7e34cd6aaf7128020f649d27ea4557cae9ec40f0..af255305ac3bd3633e2997cff15d3da00ed7d6e5 100644
--- a/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc
+++ b/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc
@@ -193,4 +193,17 @@ TEST_F(PhishingClassifierTest, TestClassification) {
EXPECT_EQ(PhishingClassifier::kInvalidScore, phishy_score);
}
+TEST_F(PhishingClassifierTest, DisableDetection) {
+ // No scorer yet, so the classifier is not ready.
+ EXPECT_FALSE(classifier_->is_ready());
+
+ // Now set the scorer.
+ classifier_->set_phishing_scorer(scorer_.get());
+ EXPECT_TRUE(classifier_->is_ready());
+
+ // Set a NULL scorer, which turns detection back off.
+ classifier_->set_phishing_scorer(NULL);
+ EXPECT_FALSE(classifier_->is_ready());
+}
+
} // namespace safe_browsing
« no previous file with comments | « chrome/renderer/safe_browsing/phishing_classifier.cc ('k') | chrome/renderer/safe_browsing/phishing_classifier_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698