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

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

Issue 16667019: Rename base/hash_tables to base/containers/hash_tables. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « chrome/renderer/safe_browsing/scorer.h ('k') | chrome/renderer/tts_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/containers/hash_tables.h"
7 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
8 #include "base/files/scoped_temp_dir.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/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/threading/thread.h" 13 #include "base/threading/thread.h"
14 #include "chrome/common/safe_browsing/client_model.pb.h" 14 #include "chrome/common/safe_browsing/client_model.pb.h"
15 #include "chrome/renderer/safe_browsing/features.h" 15 #include "chrome/renderer/safe_browsing/features.h"
16 #include "testing/gmock/include/gmock/gmock.h" 16 #include "testing/gmock/include/gmock/gmock.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 18
19 namespace safe_browsing { 19 namespace safe_browsing {
20 20
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 EXPECT_DOUBLE_EQ(0.6899744811276125, scorer->ComputeScore(features)); 118 EXPECT_DOUBLE_EQ(0.6899744811276125, scorer->ComputeScore(features));
119 119
120 // Now, both feature 1 and feature 2 match. Expected logodds: 120 // Now, both feature 1 and feature 2 match. Expected logodds:
121 // 0.5 (empty rule) + 2.0 (rule weight) * 0.15 (feature weight) + 121 // 0.5 (empty rule) + 2.0 (rule weight) * 0.15 (feature weight) +
122 // 3.0 (rule weight) * 0.15 (feature1 weight) * 1.0 (feature2) weight = 9.8 122 // 3.0 (rule weight) * 0.15 (feature1 weight) * 1.0 (feature2) weight = 9.8
123 // => p = 0.99999627336071584 123 // => p = 0.99999627336071584
124 EXPECT_TRUE(features.AddBooleanFeature("feature2")); 124 EXPECT_TRUE(features.AddBooleanFeature("feature2"));
125 EXPECT_DOUBLE_EQ(0.77729986117469119, scorer->ComputeScore(features)); 125 EXPECT_DOUBLE_EQ(0.77729986117469119, scorer->ComputeScore(features));
126 } 126 }
127 } // namespace safe_browsing 127 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/renderer/safe_browsing/scorer.h ('k') | chrome/renderer/tts_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698