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

Side by Side Diff: chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc

Issue 10449094: Fix client-side phishing detection test flakiness and ChromeOS failure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore the previous sandbox-enabled state Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // 4 //
5 // Note that although this is not a "browser" test, it runs as part of 5 // Note that although this is not a "browser" test, it runs as part of
6 // browser_tests. This is because WebKit does not work properly if it is 6 // browser_tests. This is because WebKit does not work properly if it is
7 // shutdown and re-initialized. Since browser_tests runs each test in a 7 // shutdown and re-initialized. Since browser_tests runs each test in a
8 // new process, this avoids the problem. 8 // new process, this avoids the problem.
9 9
10 #include "chrome/renderer/safe_browsing/phishing_classifier.h" 10 #include "chrome/renderer/safe_browsing/phishing_classifier.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // Features that are in the model. 125 // Features that are in the model.
126 const std::string url_tld_token_net_; 126 const std::string url_tld_token_net_;
127 const std::string page_link_domain_phishing_; 127 const std::string page_link_domain_phishing_;
128 const std::string page_term_login_; 128 const std::string page_term_login_;
129 129
130 // This member holds the status from the most recent call to the 130 // This member holds the status from the most recent call to the
131 // ClassificationFinished callback. 131 // ClassificationFinished callback.
132 ClientPhishingRequest verdict_; 132 ClientPhishingRequest verdict_;
133 }; 133 };
134 134
135 TEST_F(PhishingClassifierTest, DISABLED_TestClassification) { 135 TEST_F(PhishingClassifierTest, TestClassification) {
136 // No scorer yet, so the classifier is not ready. 136 // No scorer yet, so the classifier is not ready.
137 EXPECT_FALSE(classifier_->is_ready()); 137 EXPECT_FALSE(classifier_->is_ready());
138 138
139 // Now set the scorer. 139 // Now set the scorer.
140 classifier_->set_phishing_scorer(scorer_.get()); 140 classifier_->set_phishing_scorer(scorer_.get());
141 EXPECT_TRUE(classifier_->is_ready()); 141 EXPECT_TRUE(classifier_->is_ready());
142 142
143 // This test doesn't exercise the extraction timing. 143 // This test doesn't exercise the extraction timing.
144 EXPECT_CALL(*clock_, Now()) 144 EXPECT_CALL(*clock_, Now())
145 .WillRepeatedly(::testing::Return(base::TimeTicks::Now())); 145 .WillRepeatedly(::testing::Return(base::TimeTicks::Now()));
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // Now set the scorer. 202 // Now set the scorer.
203 classifier_->set_phishing_scorer(scorer_.get()); 203 classifier_->set_phishing_scorer(scorer_.get());
204 EXPECT_TRUE(classifier_->is_ready()); 204 EXPECT_TRUE(classifier_->is_ready());
205 205
206 // Set a NULL scorer, which turns detection back off. 206 // Set a NULL scorer, which turns detection back off.
207 classifier_->set_phishing_scorer(NULL); 207 classifier_->set_phishing_scorer(NULL);
208 EXPECT_FALSE(classifier_->is_ready()); 208 EXPECT_FALSE(classifier_->is_ready());
209 } 209 }
210 210
211 } // namespace safe_browsing 211 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698