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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 public: | 40 public: |
41 FakeLoginUI() : focus_ui_call_count_(0) {} | 41 FakeLoginUI() : focus_ui_call_count_(0) {} |
42 | 42 |
43 ~FakeLoginUI() override {} | 43 ~FakeLoginUI() override {} |
44 | 44 |
45 int focus_ui_call_count() const { return focus_ui_call_count_; } | 45 int focus_ui_call_count() const { return focus_ui_call_count_; } |
46 | 46 |
47 private: | 47 private: |
48 // Overridden from LoginUIService::LoginUI: | 48 // Overridden from LoginUIService::LoginUI: |
49 void FocusUI() override { ++focus_ui_call_count_; } | 49 void FocusUI() override { ++focus_ui_call_count_; } |
50 void CloseUI() override {} | |
51 | 50 |
52 int focus_ui_call_count_; | 51 int focus_ui_call_count_; |
53 }; | 52 }; |
54 | 53 |
55 std::unique_ptr<KeyedService> BuildMockLoginUIService( | 54 std::unique_ptr<KeyedService> BuildMockLoginUIService( |
56 content::BrowserContext* profile) { | 55 content::BrowserContext* profile) { |
57 return base::WrapUnique(new FakeLoginUIService()); | 56 return base::WrapUnique(new FakeLoginUIService()); |
58 } | 57 } |
59 | 58 |
60 // Same as BrowserWithTestWindowTest, but uses MockBrowser to test calls to | 59 // Same as BrowserWithTestWindowTest, but uses MockBrowser to test calls to |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 .WillRepeatedly(Return(true)); | 165 .WillRepeatedly(Return(true)); |
167 EXPECT_CALL(service, IsPassphraseRequiredForDecryption()) | 166 EXPECT_CALL(service, IsPassphraseRequiredForDecryption()) |
168 .WillRepeatedly(Return(true)); | 167 .WillRepeatedly(Return(true)); |
169 VerifySyncGlobalErrorResult( | 168 VerifySyncGlobalErrorResult( |
170 &service, login_ui_service, browser(), &error, &global_error, | 169 &service, login_ui_service, browser(), &error, &global_error, |
171 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, | 170 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, |
172 false /* not signed in */, false /* no error */); | 171 false /* not signed in */, false /* no error */); |
173 | 172 |
174 global_error.Shutdown(); | 173 global_error.Shutdown(); |
175 } | 174 } |
OLD | NEW |