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

Side by Side Diff: chrome/browser/safe_browsing/chunk_range_unittest.cc

Issue 1420053005: Move code in components/safe_browsing_db and chrome/browser/s_b/ under the safe_browsing namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@02_components_move
Patch Set: Remove '// namespace safe_browsing' for a small fwd decl block. Created 5 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // Test program to convert lists of integers into ranges, and vice versa. 5 // Test program to convert lists of integers into ranges, and vice versa.
6 6
7 #include "chrome/browser/safe_browsing/chunk_range.h" 7 #include "chrome/browser/safe_browsing/chunk_range.h"
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace safe_browsing {
12
11 // Test various configurations of chunk numbers. 13 // Test various configurations of chunk numbers.
12 TEST(SafeBrowsingChunkRangeTest, TestChunksToRangeString) { 14 TEST(SafeBrowsingChunkRangeTest, TestChunksToRangeString) {
13 std::vector<int> chunks; 15 std::vector<int> chunks;
14 std::string range_string; 16 std::string range_string;
15 17
16 // Test one chunk range and one single value. 18 // Test one chunk range and one single value.
17 chunks.push_back(1); 19 chunks.push_back(1);
18 chunks.push_back(2); 20 chunks.push_back(2);
19 chunks.push_back(3); 21 chunks.push_back(3);
20 chunks.push_back(4); 22 chunks.push_back(4);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 EXPECT_TRUE(IsChunkInRange(7, ranges)); 158 EXPECT_TRUE(IsChunkInRange(7, ranges));
157 EXPECT_TRUE(IsChunkInRange(300, ranges)); 159 EXPECT_TRUE(IsChunkInRange(300, ranges));
158 EXPECT_TRUE(IsChunkInRange(555, ranges)); 160 EXPECT_TRUE(IsChunkInRange(555, ranges));
159 EXPECT_TRUE(IsChunkInRange(1, ranges)); 161 EXPECT_TRUE(IsChunkInRange(1, ranges));
160 EXPECT_TRUE(IsChunkInRange(1000, ranges)); 162 EXPECT_TRUE(IsChunkInRange(1000, ranges));
161 163
162 EXPECT_FALSE(IsChunkInRange(11, ranges)); 164 EXPECT_FALSE(IsChunkInRange(11, ranges));
163 EXPECT_FALSE(IsChunkInRange(990, ranges)); 165 EXPECT_FALSE(IsChunkInRange(990, ranges));
164 EXPECT_FALSE(IsChunkInRange(2000, ranges)); 166 EXPECT_FALSE(IsChunkInRange(2000, ranges));
165 } 167 }
168
169 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/chunk_range.cc ('k') | chrome/browser/safe_browsing/client_side_detection_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698