| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "components/browser_sync/profile_sync_service_mock.h" | 10 #include "components/browser_sync/profile_sync_service_mock.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 ->AddObserver(this); | 128 ->AddObserver(this); |
| 129 } | 129 } |
| 130 | 130 |
| 131 std::unique_ptr<syncable_prefs::PrefServiceSyncable> CreatePrefService() { | 131 std::unique_ptr<syncable_prefs::PrefServiceSyncable> CreatePrefService() { |
| 132 syncable_prefs::PrefServiceMockFactory factory; | 132 syncable_prefs::PrefServiceMockFactory factory; |
| 133 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( | 133 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( |
| 134 new user_prefs::PrefRegistrySyncable); | 134 new user_prefs::PrefRegistrySyncable); |
| 135 std::unique_ptr<syncable_prefs::PrefServiceSyncable> prefs = | 135 std::unique_ptr<syncable_prefs::PrefServiceSyncable> prefs = |
| 136 factory.CreateSyncable(registry.get()); | 136 factory.CreateSyncable(registry.get()); |
| 137 RegisterBrowserStatePrefs(registry.get()); | 137 RegisterBrowserStatePrefs(registry.get()); |
| 138 AuthenticationService::RegisterPrefs(registry.get()); | |
| 139 return prefs; | 138 return prefs; |
| 140 } | 139 } |
| 141 | 140 |
| 142 void TearDown() override { | 141 void TearDown() override { |
| 143 OAuth2TokenServiceFactory::GetForBrowserState(browser_state_.get()) | 142 OAuth2TokenServiceFactory::GetForBrowserState(browser_state_.get()) |
| 144 ->RemoveObserver(this); | 143 ->RemoveObserver(this); |
| 145 authentication_service_->Shutdown(); | 144 authentication_service_->Shutdown(); |
| 146 authentication_service_.reset(); | 145 authentication_service_.reset(); |
| 147 browser_state_.reset(); | 146 browser_state_.reset(); |
| 148 TestingApplicationContext::GetGlobal()->SetChromeBrowserStateManager( | 147 TestingApplicationContext::GetGlobal()->SetChromeBrowserStateManager( |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 NSDictionary* user_info = [NSDictionary dictionary]; | 740 NSDictionary* user_info = [NSDictionary dictionary]; |
| 742 SetCachedMDMInfo(identity_, user_info); | 741 SetCachedMDMInfo(identity_, user_info); |
| 743 | 742 |
| 744 EXPECT_CALL(*identity_service_, | 743 EXPECT_CALL(*identity_service_, |
| 745 HandleMDMNotification(identity_, user_info, _)) | 744 HandleMDMNotification(identity_, user_info, _)) |
| 746 .WillOnce(Return(true)); | 745 .WillOnce(Return(true)); |
| 747 | 746 |
| 748 EXPECT_TRUE( | 747 EXPECT_TRUE( |
| 749 authentication_service_->ShowMDMErrorDialogForIdentity(identity_)); | 748 authentication_service_->ShowMDMErrorDialogForIdentity(identity_)); |
| 750 } | 749 } |
| OLD | NEW |