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 "base/run_loop.h" | 5 #include "base/run_loop.h" |
6 #include "chrome/browser/invalidation/gcm_invalidation_bridge.h" | 6 #include "chrome/browser/invalidation/gcm_invalidation_bridge.h" |
7 #include "chrome/browser/invalidation/invalidation_auth_provider.h" | 7 #include "chrome/browser/invalidation/invalidation_auth_provider.h" |
8 #include "chrome/browser/services/gcm/gcm_profile_service.h" | 8 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
9 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | 9 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
10 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" | 10 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 public: | 49 public: |
50 explicit FakeInvalidationAuthProvider( | 50 explicit FakeInvalidationAuthProvider( |
51 ProfileOAuth2TokenService* token_service) | 51 ProfileOAuth2TokenService* token_service) |
52 : token_service_(token_service) {} | 52 : token_service_(token_service) {} |
53 virtual ~FakeInvalidationAuthProvider() {} | 53 virtual ~FakeInvalidationAuthProvider() {} |
54 | 54 |
55 // InvalidationAuthProvider: | 55 // InvalidationAuthProvider: |
56 virtual OAuth2TokenService* GetTokenService() OVERRIDE { | 56 virtual OAuth2TokenService* GetTokenService() OVERRIDE { |
57 return token_service_; | 57 return token_service_; |
58 } | 58 } |
| 59 virtual std::string GetUsername() OVERRIDE { return std::string(); } |
59 virtual std::string GetAccountId() OVERRIDE { return std::string(); } | 60 virtual std::string GetAccountId() OVERRIDE { return std::string(); } |
60 virtual bool ShowLoginUI() OVERRIDE { return false; } | 61 virtual bool ShowLoginUI() OVERRIDE { return false; } |
61 | 62 |
62 private: | 63 private: |
63 OAuth2TokenService* token_service_; | 64 OAuth2TokenService* token_service_; |
64 | 65 |
65 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationAuthProvider); | 66 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationAuthProvider); |
66 }; | 67 }; |
67 | 68 |
68 class GCMInvalidationBridgeTest : public ::testing::Test { | 69 class GCMInvalidationBridgeTest : public ::testing::Test { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 delegate_->Register(base::Bind(&GCMInvalidationBridgeTest::RegisterFinished, | 163 delegate_->Register(base::Bind(&GCMInvalidationBridgeTest::RegisterFinished, |
163 base::Unretained(this))); | 164 base::Unretained(this))); |
164 base::RunLoop run_loop; | 165 base::RunLoop run_loop; |
165 run_loop.RunUntilIdle(); | 166 run_loop.RunUntilIdle(); |
166 | 167 |
167 EXPECT_FALSE(registration_id_.empty()); | 168 EXPECT_FALSE(registration_id_.empty()); |
168 } | 169 } |
169 | 170 |
170 } // namespace | 171 } // namespace |
171 } // namespace invalidation | 172 } // namespace invalidation |
OLD | NEW |