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 "chrome/browser/sync/sync_global_error.h" | 5 #include "chrome/browser/sync/sync_global_error.h" |
6 | 6 |
7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/sync/profile_sync_service_mock.h" | 8 #include "chrome/browser/sync/profile_sync_service_mock.h" |
9 #include "chrome/browser/sync/sync_error_controller.h" | 9 #include "chrome/browser/sync/sync_error_controller.h" |
10 #include "chrome/browser/sync/sync_global_error_factory.h" | 10 #include "chrome/browser/sync/sync_global_error_factory.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 class FakeLoginUI : public LoginUIService::LoginUI { | 34 class FakeLoginUI : public LoginUIService::LoginUI { |
35 public: | 35 public: |
36 FakeLoginUI() : focus_ui_call_count_(0) {} | 36 FakeLoginUI() : focus_ui_call_count_(0) {} |
37 | 37 |
38 virtual ~FakeLoginUI() {} | 38 virtual ~FakeLoginUI() {} |
39 | 39 |
40 int focus_ui_call_count() const { return focus_ui_call_count_; } | 40 int focus_ui_call_count() const { return focus_ui_call_count_; } |
41 | 41 |
42 private: | 42 private: |
43 // Overridden from LoginUIService::LoginUI: | 43 // Overridden from LoginUIService::LoginUI: |
44 virtual void FocusUI() OVERRIDE { | 44 virtual void FocusUI() override { |
45 ++focus_ui_call_count_; | 45 ++focus_ui_call_count_; |
46 } | 46 } |
47 virtual void CloseUI() OVERRIDE {} | 47 virtual void CloseUI() override {} |
48 | 48 |
49 int focus_ui_call_count_; | 49 int focus_ui_call_count_; |
50 }; | 50 }; |
51 | 51 |
52 KeyedService* BuildMockLoginUIService(content::BrowserContext* profile) { | 52 KeyedService* BuildMockLoginUIService(content::BrowserContext* profile) { |
53 return new FakeLoginUIService(); | 53 return new FakeLoginUIService(); |
54 } | 54 } |
55 | 55 |
56 // Same as BrowserWithTestWindowTest, but uses MockBrowser to test calls to | 56 // Same as BrowserWithTestWindowTest, but uses MockBrowser to test calls to |
57 // ExecuteCommand method. | 57 // ExecuteCommand method. |
58 class SyncGlobalErrorTest : public BrowserWithTestWindowTest { | 58 class SyncGlobalErrorTest : public BrowserWithTestWindowTest { |
59 public: | 59 public: |
60 SyncGlobalErrorTest() {} | 60 SyncGlobalErrorTest() {} |
61 virtual ~SyncGlobalErrorTest() {} | 61 virtual ~SyncGlobalErrorTest() {} |
62 | 62 |
63 virtual void SetUp() OVERRIDE { | 63 virtual void SetUp() override { |
64 profile_.reset(ProfileSyncServiceMock::MakeSignedInTestingProfile()); | 64 profile_.reset(ProfileSyncServiceMock::MakeSignedInTestingProfile()); |
65 | 65 |
66 BrowserWithTestWindowTest::SetUp(); | 66 BrowserWithTestWindowTest::SetUp(); |
67 } | 67 } |
68 | 68 |
69 Profile* profile() { return profile_.get(); } | 69 Profile* profile() { return profile_.get(); } |
70 | 70 |
71 private: | 71 private: |
72 scoped_ptr<TestingProfile> profile_; | 72 scoped_ptr<TestingProfile> profile_; |
73 | 73 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 .WillRepeatedly(Return(true)); | 159 .WillRepeatedly(Return(true)); |
160 EXPECT_CALL(service, IsPassphraseRequiredForDecryption()) | 160 EXPECT_CALL(service, IsPassphraseRequiredForDecryption()) |
161 .WillRepeatedly(Return(true)); | 161 .WillRepeatedly(Return(true)); |
162 VerifySyncGlobalErrorResult( | 162 VerifySyncGlobalErrorResult( |
163 &service, login_ui_service, browser(), &error, &global_error, | 163 &service, login_ui_service, browser(), &error, &global_error, |
164 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, | 164 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, |
165 false /* not signed in */, false /* no error */); | 165 false /* not signed in */, false /* no error */); |
166 | 166 |
167 global_error.Shutdown(); | 167 global_error.Shutdown(); |
168 } | 168 } |
OLD | NEW |