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

Unified Diff: chrome/renderer/safe_browsing/features_unittest.cc

Issue 2667343006: Componentize safe_browsing [X+1] : move the renderer part to component.
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/safe_browsing/features_unittest.cc
diff --git a/chrome/renderer/safe_browsing/features_unittest.cc b/chrome/renderer/safe_browsing/features_unittest.cc
deleted file mode 100644
index 0ba14e71f7cc92aa340434d490036eb32454e960..0000000000000000000000000000000000000000
--- a/chrome/renderer/safe_browsing/features_unittest.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/renderer/safe_browsing/features.h"
-
-#include <stddef.h>
-
-#include "base/format_macros.h"
-#include "base/strings/stringprintf.h"
-#include "chrome/renderer/safe_browsing/test_utils.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace safe_browsing {
-
-TEST(PhishingFeaturesTest, TooManyFeatures) {
- FeatureMap features;
- for (size_t i = 0; i < FeatureMap::kMaxFeatureMapSize; ++i) {
- EXPECT_TRUE(features.AddBooleanFeature(
- base::StringPrintf("Feature%" PRIuS, i)));
- }
- EXPECT_EQ(FeatureMap::kMaxFeatureMapSize, features.features().size());
-
- // Attempting to add more features should fail.
- for (size_t i = 0; i < 3; ++i) {
- EXPECT_FALSE(features.AddBooleanFeature(
- base::StringPrintf("Extra%" PRIuS, i)));
- }
- EXPECT_EQ(FeatureMap::kMaxFeatureMapSize, features.features().size());
-}
-
-TEST(PhishingFeaturesTest, IllegalFeatureValue) {
- FeatureMap features;
- EXPECT_FALSE(features.AddRealFeature("toosmall", -0.1));
- EXPECT_TRUE(features.AddRealFeature("zero", 0.0));
- EXPECT_TRUE(features.AddRealFeature("pointfive", 0.5));
- EXPECT_TRUE(features.AddRealFeature("one", 1.0));
- EXPECT_FALSE(features.AddRealFeature("toolarge", 1.1));
-
- FeatureMap expected_features;
- expected_features.AddRealFeature("zero", 0.0);
- expected_features.AddRealFeature("pointfive", 0.5);
- expected_features.AddRealFeature("one", 1.0);
- ExpectFeatureMapsAreEqual(features, expected_features);
-}
-
-} // namespace safe_browsing
« no previous file with comments | « chrome/renderer/safe_browsing/features.cc ('k') | chrome/renderer/safe_browsing/mock_feature_extractor_clock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698