OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/renderer/safe_browsing/phishing_classifier.h" | 5 #include "chrome/renderer/safe_browsing/phishing_classifier.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 FeatureMap features; | 338 FeatureMap features; |
339 | 339 |
340 // Extraction should fail for this case because the URL is a POST request. | 340 // Extraction should fail for this case because the URL is a POST request. |
341 LoadHtmlPost("host.net", "<html><body>content</body></html>"); | 341 LoadHtmlPost("host.net", "<html><body>content</body></html>"); |
342 EXPECT_FALSE(RunPhishingClassifier(&page_text_, &phishy_score, &features)); | 342 EXPECT_FALSE(RunPhishingClassifier(&page_text_, &phishy_score, &features)); |
343 EXPECT_EQ(0U, features.features().size()); | 343 EXPECT_EQ(0U, features.features().size()); |
344 EXPECT_EQ(PhishingClassifier::kInvalidScore, phishy_score); | 344 EXPECT_EQ(PhishingClassifier::kInvalidScore, phishy_score); |
345 } | 345 } |
346 | 346 |
347 // Test flakes with LSAN enabled. See http://crbug.com/373155. | 347 // Test flakes with LSAN enabled. See http://crbug.com/373155. |
348 #if defined(LEAK_SANITIZER) | 348 // Flaky on Linux. See http://crbug.com/638557. |
| 349 #if defined(LEAK_SANITIZER) || defined(OS_LINUX) |
349 #define MAYBE_DisableDetection DISABLED_DisableDetection | 350 #define MAYBE_DisableDetection DISABLED_DisableDetection |
350 #else | 351 #else |
351 #define MAYBE_DisableDetection DisableDetection | 352 #define MAYBE_DisableDetection DisableDetection |
352 #endif | 353 #endif |
353 IN_PROC_BROWSER_TEST_F(PhishingClassifierTest, MAYBE_DisableDetection) { | 354 IN_PROC_BROWSER_TEST_F(PhishingClassifierTest, MAYBE_DisableDetection) { |
354 EXPECT_TRUE(classifier_->is_ready()); | 355 EXPECT_TRUE(classifier_->is_ready()); |
355 | 356 |
356 // Set a NULL scorer, which turns detection back off. | 357 // Set a NULL scorer, which turns detection back off. |
357 classifier_->set_phishing_scorer(NULL); | 358 classifier_->set_phishing_scorer(NULL); |
358 EXPECT_FALSE(classifier_->is_ready()); | 359 EXPECT_FALSE(classifier_->is_ready()); |
359 } | 360 } |
360 | 361 |
361 } // namespace safe_browsing | 362 } // namespace safe_browsing |
OLD | NEW |