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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 testing::AssertionResult CheckEvents(const TrackingEvent& e1, | 129 testing::AssertionResult CheckEvents(const TrackingEvent& e1, |
130 const TrackingEvent& e2, | 130 const TrackingEvent& e2, |
131 const TrackingEvent& e3, | 131 const TrackingEvent& e3, |
132 const TrackingEvent& e4, | 132 const TrackingEvent& e4, |
133 const TrackingEvent& e5, | 133 const TrackingEvent& e5, |
134 const TrackingEvent& e6); | 134 const TrackingEvent& e6); |
135 void Clear(); | 135 void Clear(); |
136 void SortEventsByUser(); | 136 void SortEventsByUser(); |
137 | 137 |
138 // AccountTracker::Observer implementation | 138 // AccountTracker::Observer implementation |
139 virtual void OnAccountAdded(const AccountIds& ids) override; | 139 void OnAccountAdded(const AccountIds& ids) override; |
140 virtual void OnAccountRemoved(const AccountIds& ids) override; | 140 void OnAccountRemoved(const AccountIds& ids) override; |
141 virtual void OnAccountSignInChanged(const AccountIds& ids, bool is_signed_in) | 141 void OnAccountSignInChanged(const AccountIds& ids, |
142 override; | 142 bool is_signed_in) override; |
143 | 143 |
144 private: | 144 private: |
145 testing::AssertionResult CheckEvents( | 145 testing::AssertionResult CheckEvents( |
146 const std::vector<TrackingEvent>& events); | 146 const std::vector<TrackingEvent>& events); |
147 | 147 |
148 std::vector<TrackingEvent> events_; | 148 std::vector<TrackingEvent> events_; |
149 }; | 149 }; |
150 | 150 |
151 void AccountTrackerObserver::OnAccountAdded(const AccountIds& ids) { | 151 void AccountTrackerObserver::OnAccountAdded(const AccountIds& ids) { |
152 events_.push_back(TrackingEvent(ADDED, ids.email, ids.gaia)); | 152 events_.push_back(TrackingEvent(ADDED, ids.email, ids.gaia)); |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 EXPECT_TRUE(ids.email.empty()); | 807 EXPECT_TRUE(ids.email.empty()); |
808 EXPECT_TRUE(ids.gaia.empty()); | 808 EXPECT_TRUE(ids.gaia.empty()); |
809 | 809 |
810 ids = account_tracker()->FindAccountIdsByGaiaId("alpha@example.com"); | 810 ids = account_tracker()->FindAccountIdsByGaiaId("alpha@example.com"); |
811 EXPECT_TRUE(ids.account_key.empty()); | 811 EXPECT_TRUE(ids.account_key.empty()); |
812 EXPECT_TRUE(ids.email.empty()); | 812 EXPECT_TRUE(ids.email.empty()); |
813 EXPECT_TRUE(ids.gaia.empty()); | 813 EXPECT_TRUE(ids.gaia.empty()); |
814 } | 814 } |
815 | 815 |
816 } // namespace gaia | 816 } // namespace gaia |
OLD | NEW |