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

Side by Side Diff: components/signin/core/browser/account_tracker_service_unittest.cc

Issue 606083002: patch from issue 473153002 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix saml Created 6 years, 2 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 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/testing_pref_service.h" 10 #include "base/prefs/testing_pref_service.h"
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 500
501 std::vector<AccountTrackerService::AccountInfo> infos = 501 std::vector<AccountTrackerService::AccountInfo> infos =
502 tracker.GetAccounts(); 502 tracker.GetAccounts();
503 ASSERT_EQ(1u, infos.size()); 503 ASSERT_EQ(1u, infos.size());
504 EXPECT_EQ("beta", infos[0].account_id); 504 EXPECT_EQ("beta", infos[0].account_id);
505 EXPECT_EQ(AccountIdToGaiaId("beta"), infos[0].gaia); 505 EXPECT_EQ(AccountIdToGaiaId("beta"), infos[0].gaia);
506 EXPECT_EQ(AccountIdToEmail("beta"), infos[0].email); 506 EXPECT_EQ(AccountIdToEmail("beta"), infos[0].email);
507 tracker.Shutdown(); 507 tracker.Shutdown();
508 } 508 }
509 } 509 }
510
511 TEST_F(AccountTrackerServiceTest, SeedAccountInfo) {
512 std::vector<AccountTrackerService::AccountInfo> infos =
513 account_tracker()->GetAccounts();
514 EXPECT_EQ(0u, infos.size());
515
516 account_tracker()->SeedAccountInfo("alpha",
517 AccountIdToGaiaId("alpha"),
518 AccountIdToEmail("alpha"));
519
520 infos = account_tracker()->GetAccounts();
521 EXPECT_EQ(1u, infos.size());
522 EXPECT_EQ("alpha", infos[0].account_id);
523 EXPECT_EQ(AccountIdToGaiaId("alpha"), infos[0].gaia);
524 EXPECT_EQ(AccountIdToEmail("alpha"), infos[0].email);
525 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698