Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: chrome/renderer/safe_browsing/features_unittest.cc

Issue 16281006: Use a direct include of strings headers in chrome/renderer/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/features.h" 5 #include "chrome/renderer/safe_browsing/features.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/renderer/safe_browsing/test_utils.h" 9 #include "chrome/renderer/safe_browsing/test_utils.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace safe_browsing { 12 namespace safe_browsing {
13 13
14 TEST(PhishingFeaturesTest, TooManyFeatures) { 14 TEST(PhishingFeaturesTest, TooManyFeatures) {
15 FeatureMap features; 15 FeatureMap features;
16 for (size_t i = 0; i < FeatureMap::kMaxFeatureMapSize; ++i) { 16 for (size_t i = 0; i < FeatureMap::kMaxFeatureMapSize; ++i) {
17 EXPECT_TRUE(features.AddBooleanFeature( 17 EXPECT_TRUE(features.AddBooleanFeature(
18 base::StringPrintf("Feature%" PRIuS, i))); 18 base::StringPrintf("Feature%" PRIuS, i)));
(...skipping 17 matching lines...) Expand all
36 EXPECT_FALSE(features.AddRealFeature("toolarge", 1.1)); 36 EXPECT_FALSE(features.AddRealFeature("toolarge", 1.1));
37 37
38 FeatureMap expected_features; 38 FeatureMap expected_features;
39 expected_features.AddRealFeature("zero", 0.0); 39 expected_features.AddRealFeature("zero", 0.0);
40 expected_features.AddRealFeature("pointfive", 0.5); 40 expected_features.AddRealFeature("pointfive", 0.5);
41 expected_features.AddRealFeature("one", 1.0); 41 expected_features.AddRealFeature("one", 1.0);
42 ExpectFeatureMapsAreEqual(features, expected_features); 42 ExpectFeatureMapsAreEqual(features, expected_features);
43 } 43 }
44 44
45 } // namespace safe_browsing 45 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/renderer/printing/print_web_view_helper.cc ('k') | chrome/renderer/safe_browsing/malware_dom_details_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698