OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/safe_browsing_store_file.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_store_file.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 public: | 49 public: |
50 SafeBrowsingStoreFileTest() | 50 SafeBrowsingStoreFileTest() |
51 : task_runner_(new base::TestSimpleTaskRunner), | 51 : task_runner_(new base::TestSimpleTaskRunner), |
52 corruption_detected_(false) {} | 52 corruption_detected_(false) {} |
53 | 53 |
54 void SetUp() override { | 54 void SetUp() override { |
55 PlatformTest::SetUp(); | 55 PlatformTest::SetUp(); |
56 | 56 |
57 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 57 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
58 | 58 |
59 filename_ = temp_dir_.path(); | 59 filename_ = temp_dir_.GetPath(); |
60 filename_ = filename_.AppendASCII("SafeBrowsingTestStore"); | 60 filename_ = filename_.AppendASCII("SafeBrowsingTestStore"); |
61 | 61 |
62 store_.reset(new SafeBrowsingStoreFile(task_runner_)); | 62 store_.reset(new SafeBrowsingStoreFile(task_runner_)); |
63 store_->Init(filename_, | 63 store_->Init(filename_, |
64 base::Bind(&SafeBrowsingStoreFileTest::OnCorruptionDetected, | 64 base::Bind(&SafeBrowsingStoreFileTest::OnCorruptionDetected, |
65 base::Unretained(this))); | 65 base::Unretained(this))); |
66 } | 66 } |
67 void TearDown() override { | 67 void TearDown() override { |
68 if (store_.get()) | 68 if (store_.get()) |
69 store_->Delete(); | 69 store_->Delete(); |
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 std::vector<SBPrefix> prefixes_result; | 853 std::vector<SBPrefix> prefixes_result; |
854 builder.GetPrefixSetNoHashes()->GetPrefixes(&prefixes_result); | 854 builder.GetPrefixSetNoHashes()->GetPrefixes(&prefixes_result); |
855 ASSERT_EQ(1U, prefixes_result.size()); | 855 ASSERT_EQ(1U, prefixes_result.size()); |
856 EXPECT_EQ(kHash1.prefix, prefixes_result[0]); | 856 EXPECT_EQ(kHash1.prefix, prefixes_result[0]); |
857 EXPECT_TRUE(add_full_hashes_result.empty()); | 857 EXPECT_TRUE(add_full_hashes_result.empty()); |
858 } | 858 } |
859 } | 859 } |
860 #endif | 860 #endif |
861 | 861 |
862 } // namespace safe_browsing | 862 } // namespace safe_browsing |
OLD | NEW |