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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 class FakeLoginUIService: public LoginUIService { | 29 class FakeLoginUIService: public LoginUIService { |
30 public: | 30 public: |
31 FakeLoginUIService() : LoginUIService(NULL) {} | 31 FakeLoginUIService() : LoginUIService(NULL) {} |
32 }; | 32 }; |
33 | 33 |
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 ~FakeLoginUI() override {} |
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 void FocusUI() override { ++focus_ui_call_count_; } |
45 ++focus_ui_call_count_; | 45 void CloseUI() override {} |
46 } | |
47 virtual void CloseUI() override {} | |
48 | 46 |
49 int focus_ui_call_count_; | 47 int focus_ui_call_count_; |
50 }; | 48 }; |
51 | 49 |
52 KeyedService* BuildMockLoginUIService(content::BrowserContext* profile) { | 50 KeyedService* BuildMockLoginUIService(content::BrowserContext* profile) { |
53 return new FakeLoginUIService(); | 51 return new FakeLoginUIService(); |
54 } | 52 } |
55 | 53 |
56 // Same as BrowserWithTestWindowTest, but uses MockBrowser to test calls to | 54 // Same as BrowserWithTestWindowTest, but uses MockBrowser to test calls to |
57 // ExecuteCommand method. | 55 // ExecuteCommand method. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 .WillRepeatedly(Return(true)); | 157 .WillRepeatedly(Return(true)); |
160 EXPECT_CALL(service, IsPassphraseRequiredForDecryption()) | 158 EXPECT_CALL(service, IsPassphraseRequiredForDecryption()) |
161 .WillRepeatedly(Return(true)); | 159 .WillRepeatedly(Return(true)); |
162 VerifySyncGlobalErrorResult( | 160 VerifySyncGlobalErrorResult( |
163 &service, login_ui_service, browser(), &error, &global_error, | 161 &service, login_ui_service, browser(), &error, &global_error, |
164 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, | 162 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, |
165 false /* not signed in */, false /* no error */); | 163 false /* not signed in */, false /* no error */); |
166 | 164 |
167 global_error.Shutdown(); | 165 global_error.Shutdown(); |
168 } | 166 } |
OLD | NEW |