| Index: chrome/renderer/safe_browsing/phishing_term_feature_extractor_unittest.cc
|
| diff --git a/chrome/renderer/safe_browsing/phishing_term_feature_extractor_unittest.cc b/chrome/renderer/safe_browsing/phishing_term_feature_extractor_unittest.cc
|
| index b5a9979676d84f0cd0a2007b02e601190d75e530..4e7d51af2e625bdb0cf49447d500e9192bea0166 100644
|
| --- a/chrome/renderer/safe_browsing/phishing_term_feature_extractor_unittest.cc
|
| +++ b/chrome/renderer/safe_browsing/phishing_term_feature_extractor_unittest.cc
|
| @@ -4,6 +4,9 @@
|
|
|
| #include "chrome/renderer/safe_browsing/phishing_term_feature_extractor.h"
|
|
|
| +#include <stddef.h>
|
| +#include <stdint.h>
|
| +
|
| #include <string>
|
|
|
| #include "base/bind.h"
|
| @@ -17,6 +20,7 @@
|
| #include "base/strings/stringprintf.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/time/time.h"
|
| +#include "build/build_config.h"
|
| #include "chrome/renderer/safe_browsing/features.h"
|
| #include "chrome/renderer/safe_browsing/mock_feature_extractor_clock.h"
|
| #include "chrome/renderer/safe_browsing/murmurhash3_util.h"
|
| @@ -28,8 +32,7 @@
|
| using base::ASCIIToUTF16;
|
| using ::testing::Return;
|
|
|
| -
|
| -static const uint32 kMurmurHash3Seed = 2777808611U;
|
| +static const uint32_t kMurmurHash3Seed = 2777808611U;
|
|
|
| namespace safe_browsing {
|
|
|
| @@ -91,7 +94,7 @@ class PhishingTermFeatureExtractorTest : public ::testing::Test {
|
| // completion callback. Returns the success boolean from the callback.
|
| bool ExtractFeatures(const base::string16* page_text,
|
| FeatureMap* features,
|
| - std::set<uint32>* shingle_hashes) {
|
| + std::set<uint32_t>* shingle_hashes) {
|
| success_ = false;
|
| extractor_->ExtractFeatures(
|
| page_text,
|
| @@ -105,7 +108,7 @@ class PhishingTermFeatureExtractorTest : public ::testing::Test {
|
|
|
| void PartialExtractFeatures(const base::string16* page_text,
|
| FeatureMap* features,
|
| - std::set<uint32>* shingle_hashes) {
|
| + std::set<uint32_t>* shingle_hashes) {
|
| extractor_->ExtractFeatures(
|
| page_text,
|
| features,
|
| @@ -133,7 +136,7 @@ class PhishingTermFeatureExtractorTest : public ::testing::Test {
|
| MockFeatureExtractorClock clock_;
|
| scoped_ptr<PhishingTermFeatureExtractor> extractor_;
|
| base::hash_set<std::string> term_hashes_;
|
| - base::hash_set<uint32> word_hashes_;
|
| + base::hash_set<uint32_t> word_hashes_;
|
| bool success_; // holds the success value from ExtractFeatures
|
| };
|
|
|
| @@ -143,10 +146,10 @@ TEST_F(PhishingTermFeatureExtractorTest, ExtractFeatures) {
|
|
|
| base::string16 page_text = ASCIIToUTF16("blah");
|
| FeatureMap expected_features; // initially empty
|
| - std::set<uint32> expected_shingle_hashes;
|
| + std::set<uint32_t> expected_shingle_hashes;
|
|
|
| FeatureMap features;
|
| - std::set<uint32> shingle_hashes;
|
| + std::set<uint32_t> shingle_hashes;
|
| ASSERT_TRUE(ExtractFeatures(&page_text, &features, &shingle_hashes));
|
| ExpectFeatureMapsAreEqual(features, expected_features);
|
| EXPECT_THAT(expected_shingle_hashes, testing::ContainerEq(shingle_hashes));
|
| @@ -239,7 +242,7 @@ TEST_F(PhishingTermFeatureExtractorTest, ExtractFeatures) {
|
| kMurmurHash3Seed));
|
| expected_shingle_hashes.insert(MurmurHash3String("way too many words ",
|
| kMurmurHash3Seed));
|
| - std::set<uint32>::iterator it = expected_shingle_hashes.end();
|
| + std::set<uint32_t>::iterator it = expected_shingle_hashes.end();
|
| expected_shingle_hashes.erase(--it);
|
|
|
| features.Clear();
|
| @@ -331,7 +334,7 @@ TEST_F(PhishingTermFeatureExtractorTest, Continuation) {
|
| std::string("one"));
|
| expected_features.AddBooleanFeature(features::kPageTerm +
|
| std::string("two"));
|
| - std::set<uint32> expected_shingle_hashes;
|
| + std::set<uint32_t> expected_shingle_hashes;
|
| expected_shingle_hashes.insert(
|
| MurmurHash3String("one 0 1 2 ", kMurmurHash3Seed));
|
| expected_shingle_hashes.insert(
|
| @@ -388,7 +391,7 @@ TEST_F(PhishingTermFeatureExtractorTest, Continuation) {
|
| MurmurHash3String("25 26 27 two ", kMurmurHash3Seed));
|
|
|
| FeatureMap features;
|
| - std::set<uint32> shingle_hashes;
|
| + std::set<uint32_t> shingle_hashes;
|
| ASSERT_TRUE(ExtractFeatures(&page_text, &features, &shingle_hashes));
|
| ExpectFeatureMapsAreEqual(features, expected_features);
|
| EXPECT_THAT(expected_shingle_hashes, testing::ContainerEq(shingle_hashes));
|
| @@ -438,7 +441,7 @@ TEST_F(PhishingTermFeatureExtractorTest, PartialExtractionTest) {
|
| .WillOnce(Return(now + base::TimeDelta::FromMilliseconds(14)));
|
|
|
| FeatureMap features;
|
| - std::set<uint32> shingle_hashes;
|
| + std::set<uint32_t> shingle_hashes;
|
| // Extract first 10 words then stop.
|
| PartialExtractFeatures(page_text.get(), &features, &shingle_hashes);
|
|
|
|
|