OLD | NEW |
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 #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 |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "content/browser/tab_contents/test_tab_contents.h" | 24 #include "content/browser/tab_contents/test_tab_contents.h" |
25 #include "content/common/view_messages.h" | 25 #include "content/common/view_messages.h" |
26 #include "content/public/common/page_transition_types.h" | 26 #include "content/public/common/page_transition_types.h" |
27 #include "content/test/test_browser_thread.h" | 27 #include "content/test/test_browser_thread.h" |
28 #include "googleurl/src/gurl.h" | 28 #include "googleurl/src/gurl.h" |
29 #include "testing/gmock/include/gmock/gmock.h" | 29 #include "testing/gmock/include/gmock/gmock.h" |
30 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
31 | 31 |
32 using ::testing::Return; | 32 using ::testing::Return; |
33 using ::testing::StrictMock; | 33 using ::testing::StrictMock; |
| 34 using content::BrowserThread; |
34 | 35 |
35 namespace safe_browsing { | 36 namespace safe_browsing { |
36 namespace { | 37 namespace { |
37 class MockClientSideDetectionService : public ClientSideDetectionService { | 38 class MockClientSideDetectionService : public ClientSideDetectionService { |
38 public: | 39 public: |
39 MockClientSideDetectionService() : ClientSideDetectionService(NULL) {} | 40 MockClientSideDetectionService() : ClientSideDetectionService(NULL) {} |
40 virtual ~MockClientSideDetectionService() {}; | 41 virtual ~MockClientSideDetectionService() {}; |
41 | 42 |
42 MOCK_CONST_METHOD1(IsBadIpAddress, bool(const std::string&)); | 43 MOCK_CONST_METHOD1(IsBadIpAddress, bool(const std::string&)); |
43 }; | 44 }; |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 EXPECT_TRUE(features.count(StringPrintf("%s%s", | 496 EXPECT_TRUE(features.count(StringPrintf("%s%s", |
496 features::kSafeBrowsingMaliciousUrl, | 497 features::kSafeBrowsingMaliciousUrl, |
497 "http://www.malware.com/"))); | 498 "http://www.malware.com/"))); |
498 EXPECT_TRUE(features.count(StringPrintf("%s%s", | 499 EXPECT_TRUE(features.count(StringPrintf("%s%s", |
499 features::kSafeBrowsingOriginalUrl, | 500 features::kSafeBrowsingOriginalUrl, |
500 "http://www.good.com/"))); | 501 "http://www.good.com/"))); |
501 EXPECT_DOUBLE_EQ(1.0, features[features::kSafeBrowsingIsSubresource]); | 502 EXPECT_DOUBLE_EQ(1.0, features[features::kSafeBrowsingIsSubresource]); |
502 EXPECT_DOUBLE_EQ(2.0, features[features::kSafeBrowsingThreatType]); | 503 EXPECT_DOUBLE_EQ(2.0, features[features::kSafeBrowsingThreatType]); |
503 } | 504 } |
504 } // namespace safe_browsing | 505 } // namespace safe_browsing |
OLD | NEW |