OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/safe_browsing_db/database_manager.h" | 5 #include "components/safe_browsing_db/database_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 bool callback_invoked_; | 125 bool callback_invoked_; |
126 DISALLOW_COPY_AND_ASSIGN(TestClient); | 126 DISALLOW_COPY_AND_ASSIGN(TestClient); |
127 }; | 127 }; |
128 | 128 |
129 } // namespace | 129 } // namespace |
130 | 130 |
131 class SafeBrowsingDatabaseManagerTest : public testing::Test { | 131 class SafeBrowsingDatabaseManagerTest : public testing::Test { |
132 protected: | 132 protected: |
133 void SetUp() override { | 133 void SetUp() override { |
134 V4GetHashProtocolManager::RegisterFactory( | 134 V4GetHashProtocolManager::RegisterFactory( |
135 base::WrapUnique(new TestV4GetHashProtocolManagerFactory())); | 135 base::MakeUnique<TestV4GetHashProtocolManagerFactory>()); |
136 | 136 |
137 db_manager_ = new TestSafeBrowsingDatabaseManager(); | 137 db_manager_ = new TestSafeBrowsingDatabaseManager(); |
138 db_manager_->StartOnIOThread(NULL, V4ProtocolConfig()); | 138 db_manager_->StartOnIOThread(NULL, V4ProtocolConfig()); |
139 } | 139 } |
140 | 140 |
141 void TearDown() override { | 141 void TearDown() override { |
142 base::RunLoop().RunUntilIdle(); | 142 base::RunLoop().RunUntilIdle(); |
143 db_manager_->StopOnIOThread(false); | 143 db_manager_->StopOnIOThread(false); |
144 V4GetHashProtocolManager::RegisterFactory(nullptr); | 144 V4GetHashProtocolManager::RegisterFactory(nullptr); |
145 } | 145 } |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 EXPECT_NE(cache.end(), entry); | 531 EXPECT_NE(cache.end(), entry); |
532 EXPECT_EQ(epoch, entry->second.expire_after); | 532 EXPECT_EQ(epoch, entry->second.expire_after); |
533 EXPECT_EQ(1ul, entry->second.full_hashes.size()); | 533 EXPECT_EQ(1ul, entry->second.full_hashes.size()); |
534 EXPECT_TRUE(SBFullHashEqual(full_hash_result.hash, | 534 EXPECT_TRUE(SBFullHashEqual(full_hash_result.hash, |
535 entry->second.full_hashes[0].hash)); | 535 entry->second.full_hashes[0].hash)); |
536 EXPECT_EQ(base::Time::Max(), | 536 EXPECT_EQ(base::Time::Max(), |
537 entry->second.full_hashes[0].cache_expire_after); | 537 entry->second.full_hashes[0].cache_expire_after); |
538 } | 538 } |
539 | 539 |
540 } // namespace safe_browsing | 540 } // namespace safe_browsing |
OLD | NEW |