| 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_term_feature_extractor.h" | 5 #include "components/safe_browsing/renderer/phishing_term_feature_extractor.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/containers/hash_tables.h" | 15 #include "base/containers/hash_tables.h" |
| 16 #include "base/location.h" | 16 #include "base/location.h" |
| 17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 18 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
| 19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 20 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
| 21 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
| 22 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
| 23 #include "base/time/time.h" | 23 #include "base/time/time.h" |
| 24 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 25 #include "chrome/renderer/safe_browsing/features.h" | 25 #include "components/safe_browsing/renderer/features.h" |
| 26 #include "chrome/renderer/safe_browsing/mock_feature_extractor_clock.h" | 26 #include "components/safe_browsing/renderer/mock_feature_extractor_clock.h" |
| 27 #include "chrome/renderer/safe_browsing/murmurhash3_util.h" | 27 #include "components/safe_browsing/renderer/murmurhash3_util.h" |
| 28 #include "chrome/renderer/safe_browsing/test_utils.h" | 28 #include "components/safe_browsing/renderer/test_utils.h" |
| 29 #include "crypto/sha2.h" | 29 #include "crypto/sha2.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 base::ASCIIToUTF16; | 33 using base::ASCIIToUTF16; |
| 34 using ::testing::Return; | 34 using ::testing::Return; |
| 35 | 35 |
| 36 static const uint32_t kMurmurHash3Seed = 2777808611U; | 36 static const uint32_t kMurmurHash3Seed = 2777808611U; |
| 37 | 37 |
| 38 namespace safe_browsing { | 38 namespace safe_browsing { |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 // Now extract normally and make sure nothing breaks. | 460 // Now extract normally and make sure nothing breaks. |
| 461 EXPECT_TRUE(ExtractFeatures(page_text.get(), &features, &shingle_hashes)); | 461 EXPECT_TRUE(ExtractFeatures(page_text.get(), &features, &shingle_hashes)); |
| 462 | 462 |
| 463 FeatureMap expected_features; | 463 FeatureMap expected_features; |
| 464 expected_features.AddBooleanFeature(features::kPageTerm + | 464 expected_features.AddBooleanFeature(features::kPageTerm + |
| 465 std::string("multi word test")); | 465 std::string("multi word test")); |
| 466 ExpectFeatureMapsAreEqual(features, expected_features); | 466 ExpectFeatureMapsAreEqual(features, expected_features); |
| 467 } | 467 } |
| 468 | 468 |
| 469 } // namespace safe_browsing | 469 } // namespace safe_browsing |
| OLD | NEW |