OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/password_manager/core/browser/affiliation_backend.h" | 5 #include "components/password_manager/core/browser/affiliation_backend.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 | 118 |
119 ScopedFakeAffiliationAPI* fake_affiliation_api() { | 119 ScopedFakeAffiliationAPI* fake_affiliation_api() { |
120 return &fake_affiliation_api_; | 120 return &fake_affiliation_api_; |
121 } | 121 } |
122 | 122 |
123 private: | 123 private: |
124 // testing::Test: | 124 // testing::Test: |
125 void SetUp() override { | 125 void SetUp() override { |
126 clock_->Advance(base::TimeDelta::FromMicroseconds(1)); | 126 clock_->Advance(base::TimeDelta::FromMicroseconds(1)); |
127 backend_.reset(new AffiliationBackend(NULL, make_scoped_ptr(clock_))); | 127 backend_.reset(new AffiliationBackend(nullptr, make_scoped_ptr(clock_))); |
128 | 128 |
129 base::FilePath database_path; | 129 base::FilePath database_path; |
130 ASSERT_TRUE(CreateTemporaryFile(&database_path)); | 130 ASSERT_TRUE(CreateTemporaryFile(&database_path)); |
131 backend_->Initialize(database_path); | 131 backend_->Initialize(database_path); |
132 | 132 |
133 fake_affiliation_api_.AddTestEquivalenceClass( | 133 fake_affiliation_api_.AddTestEquivalenceClass( |
134 GetTestEquivalenceClassAlpha()); | 134 GetTestEquivalenceClassAlpha()); |
135 fake_affiliation_api_.AddTestEquivalenceClass( | 135 fake_affiliation_api_.AddTestEquivalenceClass( |
136 GetTestEquivalenceClassBeta()); | 136 GetTestEquivalenceClassBeta()); |
137 fake_affiliation_api_.AddTestEquivalenceClass( | 137 fake_affiliation_api_.AddTestEquivalenceClass( |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // Currently, a GetAffiliations() request can only be blocked due to fetch in | 309 // Currently, a GetAffiliations() request can only be blocked due to fetch in |
310 // flight -- so emulate this condition when destroying the backend. | 310 // flight -- so emulate this condition when destroying the backend. |
311 fake_affiliation_api()->IgnoreNextRequest(); | 311 fake_affiliation_api()->IgnoreNextRequest(); |
312 DestroyBackend(); | 312 DestroyBackend(); |
313 mock_consumer()->ExpectFailure(); | 313 mock_consumer()->ExpectFailure(); |
314 consumer_task_runner()->RunUntilIdle(); | 314 consumer_task_runner()->RunUntilIdle(); |
315 testing::Mock::VerifyAndClearExpectations(mock_consumer()); | 315 testing::Mock::VerifyAndClearExpectations(mock_consumer()); |
316 } | 316 } |
317 | 317 |
318 } // namespace password_manager | 318 } // namespace password_manager |
OLD | NEW |