OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "google_apis/gaia/account_tracker.h" | 5 #include "google_apis/gaia/account_tracker.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 << "Expected " << maybe_newline << Str(events) << ", " | 257 << "Expected " << maybe_newline << Str(events) << ", " |
258 << maybe_newline << "Got " << maybe_newline << Str(events_))); | 258 << maybe_newline << "Got " << maybe_newline << Str(events_))); |
259 events_.clear(); | 259 events_.clear(); |
260 return result; | 260 return result; |
261 } | 261 } |
262 | 262 |
263 class IdentityAccountTrackerTest : public testing::Test { | 263 class IdentityAccountTrackerTest : public testing::Test { |
264 public: | 264 public: |
265 IdentityAccountTrackerTest() {} | 265 IdentityAccountTrackerTest() {} |
266 | 266 |
267 virtual ~IdentityAccountTrackerTest() {} | 267 ~IdentityAccountTrackerTest() override {} |
268 | 268 |
269 virtual void SetUp() override { | 269 void SetUp() override { |
270 | |
271 fake_oauth2_token_service_.reset(new FakeOAuth2TokenService()); | 270 fake_oauth2_token_service_.reset(new FakeOAuth2TokenService()); |
272 | 271 |
273 fake_identity_provider_.reset( | 272 fake_identity_provider_.reset( |
274 new FakeIdentityProvider(fake_oauth2_token_service_.get())); | 273 new FakeIdentityProvider(fake_oauth2_token_service_.get())); |
275 | 274 |
276 account_tracker_.reset( | 275 account_tracker_.reset( |
277 new AccountTracker(fake_identity_provider_.get(), | 276 new AccountTracker(fake_identity_provider_.get(), |
278 new net::TestURLRequestContextGetter( | 277 new net::TestURLRequestContextGetter( |
279 message_loop_.message_loop_proxy()))); | 278 message_loop_.message_loop_proxy()))); |
280 account_tracker_->AddObserver(&observer_); | 279 account_tracker_->AddObserver(&observer_); |
281 } | 280 } |
282 | 281 |
283 virtual void TearDown() override { | 282 void TearDown() override { |
284 account_tracker_->RemoveObserver(&observer_); | 283 account_tracker_->RemoveObserver(&observer_); |
285 account_tracker_->Shutdown(); | 284 account_tracker_->Shutdown(); |
286 } | 285 } |
287 | 286 |
288 AccountTrackerObserver* observer() { | 287 AccountTrackerObserver* observer() { |
289 return &observer_; | 288 return &observer_; |
290 } | 289 } |
291 | 290 |
292 AccountTracker* account_tracker() { | 291 AccountTracker* account_tracker() { |
293 return account_tracker_.get(); | 292 return account_tracker_.get(); |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 EXPECT_TRUE(ids.email.empty()); | 806 EXPECT_TRUE(ids.email.empty()); |
808 EXPECT_TRUE(ids.gaia.empty()); | 807 EXPECT_TRUE(ids.gaia.empty()); |
809 | 808 |
810 ids = account_tracker()->FindAccountIdsByGaiaId("alpha@example.com"); | 809 ids = account_tracker()->FindAccountIdsByGaiaId("alpha@example.com"); |
811 EXPECT_TRUE(ids.account_key.empty()); | 810 EXPECT_TRUE(ids.account_key.empty()); |
812 EXPECT_TRUE(ids.email.empty()); | 811 EXPECT_TRUE(ids.email.empty()); |
813 EXPECT_TRUE(ids.gaia.empty()); | 812 EXPECT_TRUE(ids.gaia.empty()); |
814 } | 813 } |
815 | 814 |
816 } // namespace gaia | 815 } // namespace gaia |
OLD | NEW |