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 "chrome/browser/services/gcm/gcm_account_tracker.h" | 5 #include "chrome/browser/services/gcm/gcm_account_tracker.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 update_accounts_called_ = false; | 139 update_accounts_called_ = false; |
140 last_connection_observer_ = NULL; | 140 last_connection_observer_ = NULL; |
141 removed_connection_observer_ = NULL; | 141 removed_connection_observer_ = NULL; |
142 } | 142 } |
143 | 143 |
144 } // namespace | 144 } // namespace |
145 | 145 |
146 class GCMAccountTrackerTest : public testing::Test { | 146 class GCMAccountTrackerTest : public testing::Test { |
147 public: | 147 public: |
148 GCMAccountTrackerTest(); | 148 GCMAccountTrackerTest(); |
149 virtual ~GCMAccountTrackerTest(); | 149 ~GCMAccountTrackerTest() override; |
150 | 150 |
151 // Helpers to pass fake events to the tracker. Tests should have either a pair | 151 // Helpers to pass fake events to the tracker. Tests should have either a pair |
152 // of Start/FinishAccountSignIn or SignInAccount per account. Don't mix. | 152 // of Start/FinishAccountSignIn or SignInAccount per account. Don't mix. |
153 // Call to SignOutAccount is not mandatory. | 153 // Call to SignOutAccount is not mandatory. |
154 void StartAccountSignIn(const std::string& account_key); | 154 void StartAccountSignIn(const std::string& account_key); |
155 void FinishAccountSignIn(const std::string& account_key); | 155 void FinishAccountSignIn(const std::string& account_key); |
156 void SignInAccount(const std::string& account_key); | 156 void SignInAccount(const std::string& account_key); |
157 void SignOutAccount(const std::string& account_key); | 157 void SignOutAccount(const std::string& account_key); |
158 | 158 |
159 // Helpers for dealing with OAuth2 access token requests. | 159 // Helpers for dealing with OAuth2 access token requests. |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 // clean it up before the SetAccessToken is called. This also means a new | 418 // clean it up before the SetAccessToken is called. This also means a new |
419 // token request will be issued | 419 // token request will be issued |
420 EXPECT_FALSE(driver()->update_accounts_called()); | 420 EXPECT_FALSE(driver()->update_accounts_called()); |
421 EXPECT_EQ(1UL, tracker()->get_pending_token_request_count()); | 421 EXPECT_EQ(1UL, tracker()->get_pending_token_request_count()); |
422 } | 422 } |
423 | 423 |
424 // TODO(fgorski): Add test for adding account after removal >> make sure it does | 424 // TODO(fgorski): Add test for adding account after removal >> make sure it does |
425 // not mark removal. | 425 // not mark removal. |
426 | 426 |
427 } // namespace gcm | 427 } // namespace gcm |
OLD | NEW |