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

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

Issue 1870003002: Convert //chrome/browser/safe_browsing from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and address comments Created 4 years, 8 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
OLDNEW
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 const long kOffset = 4 * sizeof(uint32_t); 118 const long kOffset = 4 * sizeof(uint32_t);
119 EXPECT_EQ(fseek(file.get(), kOffset, SEEK_SET), 0); 119 EXPECT_EQ(fseek(file.get(), kOffset, SEEK_SET), 0);
120 uint32_t shard_stride = 0; 120 uint32_t shard_stride = 0;
121 EXPECT_EQ(fread(&shard_stride, sizeof(shard_stride), 1, file.get()), 1U); 121 EXPECT_EQ(fread(&shard_stride, sizeof(shard_stride), 1, file.get()), 1U);
122 return shard_stride; 122 return shard_stride;
123 } 123 }
124 124
125 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; 125 scoped_refptr<base::TestSimpleTaskRunner> task_runner_;
126 base::ScopedTempDir temp_dir_; 126 base::ScopedTempDir temp_dir_;
127 base::FilePath filename_; 127 base::FilePath filename_;
128 scoped_ptr<SafeBrowsingStoreFile> store_; 128 std::unique_ptr<SafeBrowsingStoreFile> store_;
129 bool corruption_detected_; 129 bool corruption_detected_;
130 }; 130 };
131 131
132 // Test that the empty store looks empty. 132 // Test that the empty store looks empty.
133 TEST_F(SafeBrowsingStoreFileTest, Empty) { 133 TEST_F(SafeBrowsingStoreFileTest, Empty) {
134 ASSERT_TRUE(store_->BeginUpdate()); 134 ASSERT_TRUE(store_->BeginUpdate());
135 135
136 std::vector<int> chunks; 136 std::vector<int> chunks;
137 store_->GetAddChunks(&chunks); 137 store_->GetAddChunks(&chunks);
138 EXPECT_TRUE(chunks.empty()); 138 EXPECT_TRUE(chunks.empty());
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698