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

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

Issue 11359217: Move scoped_temp_dir from base to base/files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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) 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/renderer/safe_browsing/scorer.h" 5 #include "chrome/renderer/safe_browsing/scorer.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/scoped_temp_dir.h"
9 #include "base/format_macros.h" 10 #include "base/format_macros.h"
10 #include "base/hash_tables.h" 11 #include "base/hash_tables.h"
11 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
12 #include "base/message_loop.h" 13 #include "base/message_loop.h"
13 #include "base/scoped_temp_dir.h"
14 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
15 #include "chrome/common/safe_browsing/client_model.pb.h" 15 #include "chrome/common/safe_browsing/client_model.pb.h"
16 #include "chrome/renderer/safe_browsing/features.h" 16 #include "chrome/renderer/safe_browsing/features.h"
17 #include "testing/gmock/include/gmock/gmock.h" 17 #include "testing/gmock/include/gmock/gmock.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 19
20 namespace safe_browsing { 20 namespace safe_browsing {
21 21
22 class PhishingScorerTest : public ::testing::Test { 22 class PhishingScorerTest : public ::testing::Test {
23 protected: 23 protected:
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 EXPECT_DOUBLE_EQ(0.6899744811276125, scorer->ComputeScore(features)); 119 EXPECT_DOUBLE_EQ(0.6899744811276125, scorer->ComputeScore(features));
120 120
121 // Now, both feature 1 and feature 2 match. Expected logodds: 121 // Now, both feature 1 and feature 2 match. Expected logodds:
122 // 0.5 (empty rule) + 2.0 (rule weight) * 0.15 (feature weight) + 122 // 0.5 (empty rule) + 2.0 (rule weight) * 0.15 (feature weight) +
123 // 3.0 (rule weight) * 0.15 (feature1 weight) * 1.0 (feature2) weight = 9.8 123 // 3.0 (rule weight) * 0.15 (feature1 weight) * 1.0 (feature2) weight = 9.8
124 // => p = 0.99999627336071584 124 // => p = 0.99999627336071584
125 EXPECT_TRUE(features.AddBooleanFeature("feature2")); 125 EXPECT_TRUE(features.AddBooleanFeature("feature2"));
126 EXPECT_DOUBLE_EQ(0.77729986117469119, scorer->ComputeScore(features)); 126 EXPECT_DOUBLE_EQ(0.77729986117469119, scorer->ComputeScore(features));
127 } 127 }
128 } // namespace safe_browsing 128 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/installer/util/work_item_list_unittest.cc ('k') | chrome/service/cloud_print/connector_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698