| 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/browser/safe_browsing/browser_feature_extractor.h" | 5 #include "chrome/browser/safe_browsing/browser_feature_extractor.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "chrome/browser/history/history.h" | 15 #include "chrome/browser/history/history.h" |
| 16 #include "chrome/browser/history/history_backend.h" | 16 #include "chrome/browser/history/history_backend.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/safe_browsing/browser_features.h" | 18 #include "chrome/browser/safe_browsing/browser_features.h" |
| 19 #include "chrome/browser/safe_browsing/client_side_detection_service.h" | 19 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
| 20 #include "chrome/common/safe_browsing/csd.pb.h" | 20 #include "chrome/common/safe_browsing/csd.pb.h" |
| 21 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 21 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 22 #include "chrome/test/base/testing_profile.h" | 22 #include "chrome/test/base/testing_profile.h" |
| 23 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
| 24 #include "content/public/common/page_transition_types.h" | 24 #include "content/public/common/page_transition_types.h" |
| 25 #include "content/public/common/referrer.h" | 25 #include "content/public/common/referrer.h" |
| 26 #include "content/public/browser/navigation_controller.h" | 26 #include "content/public/browser/navigation_controller.h" |
| 27 #include "content/public/test/test_browser_thread.h" | 27 #include "content/public/test/test_browser_thread.h" |
| 28 #include "content/test/web_contents_tester.h" | 28 #include "content/public/test/web_contents_tester.h" |
| 29 #include "googleurl/src/gurl.h" | 29 #include "googleurl/src/gurl.h" |
| 30 #include "testing/gmock/include/gmock/gmock.h" | 30 #include "testing/gmock/include/gmock/gmock.h" |
| 31 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
| 32 | 32 |
| 33 using ::testing::Return; | 33 using ::testing::Return; |
| 34 using ::testing::StrictMock; | 34 using ::testing::StrictMock; |
| 35 using content::BrowserThread; | 35 using content::BrowserThread; |
| 36 using content::WebContentsTester; | 36 using content::WebContentsTester; |
| 37 | 37 |
| 38 namespace safe_browsing { | 38 namespace safe_browsing { |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 EXPECT_TRUE(features.count(StringPrintf("%s%s", | 499 EXPECT_TRUE(features.count(StringPrintf("%s%s", |
| 500 features::kSafeBrowsingMaliciousUrl, | 500 features::kSafeBrowsingMaliciousUrl, |
| 501 "http://www.malware.com/"))); | 501 "http://www.malware.com/"))); |
| 502 EXPECT_TRUE(features.count(StringPrintf("%s%s", | 502 EXPECT_TRUE(features.count(StringPrintf("%s%s", |
| 503 features::kSafeBrowsingOriginalUrl, | 503 features::kSafeBrowsingOriginalUrl, |
| 504 "http://www.good.com/"))); | 504 "http://www.good.com/"))); |
| 505 EXPECT_DOUBLE_EQ(1.0, features[features::kSafeBrowsingIsSubresource]); | 505 EXPECT_DOUBLE_EQ(1.0, features[features::kSafeBrowsingIsSubresource]); |
| 506 EXPECT_DOUBLE_EQ(2.0, features[features::kSafeBrowsingThreatType]); | 506 EXPECT_DOUBLE_EQ(2.0, features[features::kSafeBrowsingThreatType]); |
| 507 } | 507 } |
| 508 } // namespace safe_browsing | 508 } // namespace safe_browsing |
| OLD | NEW |