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 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
16 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 17 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
18 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/common/safe_browsing/client_model.pb.h" | 19 #include "chrome/common/safe_browsing/client_model.pb.h" |
20 #include "chrome/common/safe_browsing/csd.pb.h" | |
21 #include "chrome/renderer/safe_browsing/features.h" | 20 #include "chrome/renderer/safe_browsing/features.h" |
22 #include "chrome/renderer/safe_browsing/mock_feature_extractor_clock.h" | 21 #include "chrome/renderer/safe_browsing/mock_feature_extractor_clock.h" |
23 #include "chrome/renderer/safe_browsing/murmurhash3_util.h" | 22 #include "chrome/renderer/safe_browsing/murmurhash3_util.h" |
24 #include "chrome/renderer/safe_browsing/scorer.h" | 23 #include "chrome/renderer/safe_browsing/scorer.h" |
25 #include "chrome/test/base/in_process_browser_test.h" | 24 #include "chrome/test/base/in_process_browser_test.h" |
26 #include "chrome/test/base/ui_test_utils.h" | 25 #include "chrome/test/base/ui_test_utils.h" |
| 26 #include "components/safe_browsing/csd.pb.h" |
27 #include "content/public/browser/render_frame_host.h" | 27 #include "content/public/browser/render_frame_host.h" |
28 #include "content/public/browser/web_contents.h" | 28 #include "content/public/browser/web_contents.h" |
29 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
30 #include "content/public/renderer/render_frame.h" | 30 #include "content/public/renderer/render_frame.h" |
31 #include "crypto/sha2.h" | 31 #include "crypto/sha2.h" |
32 #include "net/dns/mock_host_resolver.h" | 32 #include "net/dns/mock_host_resolver.h" |
33 #include "net/test/embedded_test_server/embedded_test_server.h" | 33 #include "net/test/embedded_test_server/embedded_test_server.h" |
34 #include "net/test/embedded_test_server/http_response.h" | 34 #include "net/test/embedded_test_server/http_response.h" |
35 #include "testing/gmock/include/gmock/gmock.h" | 35 #include "testing/gmock/include/gmock/gmock.h" |
36 #include "url/gurl.h" | 36 #include "url/gurl.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 #endif | 353 #endif |
354 IN_PROC_BROWSER_TEST_F(PhishingClassifierTest, MAYBE_DisableDetection) { | 354 IN_PROC_BROWSER_TEST_F(PhishingClassifierTest, MAYBE_DisableDetection) { |
355 EXPECT_TRUE(classifier_->is_ready()); | 355 EXPECT_TRUE(classifier_->is_ready()); |
356 | 356 |
357 // Set a NULL scorer, which turns detection back off. | 357 // Set a NULL scorer, which turns detection back off. |
358 classifier_->set_phishing_scorer(NULL); | 358 classifier_->set_phishing_scorer(NULL); |
359 EXPECT_FALSE(classifier_->is_ready()); | 359 EXPECT_FALSE(classifier_->is_ready()); |
360 } | 360 } |
361 | 361 |
362 } // namespace safe_browsing | 362 } // namespace safe_browsing |
OLD | NEW |