OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <set> | 5 #include <set> |
6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/signin/fake_signin_manager.h" | 9 #include "chrome/browser/signin/fake_signin_manager.h" |
10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // tests are unaffected, but STATUS_CASE_AUTHENTICATING can't exist in both | 174 // tests are unaffected, but STATUS_CASE_AUTHENTICATING can't exist in both |
175 // versions, so it we will require two separate tests, one using SigninManager | 175 // versions, so it we will require two separate tests, one using SigninManager |
176 // and one using SigninManagerBase (which require different setup procedures. | 176 // and one using SigninManagerBase (which require different setup procedures. |
177 class FakeSigninManagerForSyncUIUtilTest : public FakeSigninManagerBase { | 177 class FakeSigninManagerForSyncUIUtilTest : public FakeSigninManagerBase { |
178 public: | 178 public: |
179 explicit FakeSigninManagerForSyncUIUtilTest(Profile* profile) | 179 explicit FakeSigninManagerForSyncUIUtilTest(Profile* profile) |
180 : FakeSigninManagerBase(profile), auth_in_progress_(false) { | 180 : FakeSigninManagerBase(profile), auth_in_progress_(false) { |
181 Initialize(NULL); | 181 Initialize(NULL); |
182 } | 182 } |
183 | 183 |
184 virtual ~FakeSigninManagerForSyncUIUtilTest() { | 184 ~FakeSigninManagerForSyncUIUtilTest() override {} |
185 } | |
186 | 185 |
187 virtual bool AuthInProgress() const override { | 186 bool AuthInProgress() const override { return auth_in_progress_; } |
188 return auth_in_progress_; | |
189 } | |
190 | 187 |
191 void set_auth_in_progress() { | 188 void set_auth_in_progress() { |
192 auth_in_progress_ = true; | 189 auth_in_progress_ = true; |
193 } | 190 } |
194 | 191 |
195 private: | 192 private: |
196 bool auth_in_progress_; | 193 bool auth_in_progress_; |
197 }; | 194 }; |
198 | 195 |
199 // Loads a ProfileSyncServiceMock to emulate one of a number of distinct cases | 196 // Loads a ProfileSyncServiceMock to emulate one of a number of distinct cases |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 EXPECT_FALSE(status_label.empty()); | 399 EXPECT_FALSE(status_label.empty()); |
403 EXPECT_EQ(status_label.find(base::ASCIIToUTF16("href")), | 400 EXPECT_EQ(status_label.find(base::ASCIIToUTF16("href")), |
404 base::string16::npos); | 401 base::string16::npos); |
405 testing::Mock::VerifyAndClearExpectations(&service); | 402 testing::Mock::VerifyAndClearExpectations(&service); |
406 testing::Mock::VerifyAndClearExpectations(&signin); | 403 testing::Mock::VerifyAndClearExpectations(&signin); |
407 EXPECT_CALL(service, GetAuthError()).WillRepeatedly(ReturnRef(error)); | 404 EXPECT_CALL(service, GetAuthError()).WillRepeatedly(ReturnRef(error)); |
408 provider.reset(); | 405 provider.reset(); |
409 signin.Shutdown(); | 406 signin.Shutdown(); |
410 } | 407 } |
411 } | 408 } |
OLD | NEW |