OLD | NEW |
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/browser/safe_browsing/prefix_set.h" | 5 #include "chrome/browser/safe_browsing/prefix_set.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/md5.h" | 11 #include "base/md5.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/scoped_temp_dir.h" | |
14 #include "base/rand_util.h" | 13 #include "base/rand_util.h" |
| 14 #include "base/scoped_temp_dir.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "testing/platform_test.h" | 16 #include "testing/platform_test.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 class PrefixSetTest : public PlatformTest { | 20 class PrefixSetTest : public PlatformTest { |
21 protected: | 21 protected: |
22 // Constants for the v1 format. | 22 // Constants for the v1 format. |
23 static const size_t kMagicOffset = 0 * sizeof(uint32); | 23 static const size_t kMagicOffset = 0 * sizeof(uint32); |
24 static const size_t kVersionOffset = 1 * sizeof(uint32); | 24 static const size_t kVersionOffset = 1 * sizeof(uint32); |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 if (delta > 0xFFFF) { | 447 if (delta > 0xFFFF) { |
448 EXPECT_FALSE(prefix_set.IsDeltaAt(i)); | 448 EXPECT_FALSE(prefix_set.IsDeltaAt(i)); |
449 } else { | 449 } else { |
450 ASSERT_TRUE(prefix_set.IsDeltaAt(i)); | 450 ASSERT_TRUE(prefix_set.IsDeltaAt(i)); |
451 EXPECT_EQ(delta, prefix_set.DeltaAt(i)); | 451 EXPECT_EQ(delta, prefix_set.DeltaAt(i)); |
452 } | 452 } |
453 } | 453 } |
454 } | 454 } |
455 | 455 |
456 } // namespace | 456 } // namespace |
OLD | NEW |