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 "chrome/browser/extensions/external_provider_impl.h" | 5 #include "chrome/browser/extensions/external_provider_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/test/scoped_path_override.h" | 9 #include "base/test/scoped_path_override.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
11 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 11 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
12 #include "chrome/browser/chromeos/customization/customization_document.h" | 12 #include "chrome/browser/chromeos/customization/customization_document.h" |
13 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 13 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
14 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
15 #include "chrome/browser/extensions/extension_service_test_base.h" | 15 #include "chrome/browser/extensions/extension_service_test_base.h" |
16 #include "chrome/browser/prefs/pref_service_syncable.h" | 16 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 17 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
17 #include "chrome/browser/profiles/profile_manager.h" | 18 #include "chrome/browser/profiles/profile_manager.h" |
18 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 19 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
19 #include "chrome/browser/signin/signin_manager_factory.h" | 20 #include "chrome/browser/signin/signin_manager_factory.h" |
20 #include "chrome/browser/sync/profile_sync_service.h" | 21 #include "chrome/browser/sync/profile_sync_service.h" |
21 #include "chrome/browser/sync/profile_sync_service_factory.h" | 22 #include "chrome/browser/sync/profile_sync_service_factory.h" |
22 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
24 #include "chrome/test/base/testing_browser_process.h" | 25 #include "chrome/test/base/testing_browser_process.h" |
25 #include "chrome/test/base/testing_profile.h" | 26 #include "chrome/test/base/testing_profile.h" |
26 #include "chromeos/system/fake_statistics_provider.h" | 27 #include "chromeos/system/fake_statistics_provider.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 // User is logged in. | 186 // User is logged in. |
186 SigninManagerBase* signin = | 187 SigninManagerBase* signin = |
187 SigninManagerFactory::GetForProfile(profile_.get()); | 188 SigninManagerFactory::GetForProfile(profile_.get()); |
188 signin->SetAuthenticatedAccountInfo("gaia-id-test_user@gmail.com", | 189 signin->SetAuthenticatedAccountInfo("gaia-id-test_user@gmail.com", |
189 "test_user@gmail.com"); | 190 "test_user@gmail.com"); |
190 | 191 |
191 // App sync will wait for priority sync to complete. | 192 // App sync will wait for priority sync to complete. |
192 service_->CheckForExternalUpdates(); | 193 service_->CheckForExternalUpdates(); |
193 | 194 |
194 // Priority sync completed. | 195 // Priority sync completed. |
195 PrefServiceSyncable::FromProfile(profile_.get()) | 196 PrefServiceSyncableFromProfile(profile_.get()) |
196 ->GetSyncableService(syncer::PRIORITY_PREFERENCES) | 197 ->GetSyncableService(syncer::PRIORITY_PREFERENCES) |
197 ->MergeDataAndStartSyncing(syncer::PRIORITY_PREFERENCES, | 198 ->MergeDataAndStartSyncing(syncer::PRIORITY_PREFERENCES, |
198 syncer::SyncDataList(), | 199 syncer::SyncDataList(), |
199 scoped_ptr<syncer::SyncChangeProcessor>( | 200 scoped_ptr<syncer::SyncChangeProcessor>( |
200 new syncer::FakeSyncChangeProcessor), | 201 new syncer::FakeSyncChangeProcessor), |
201 scoped_ptr<syncer::SyncErrorFactory>( | 202 scoped_ptr<syncer::SyncErrorFactory>( |
202 new syncer::SyncErrorFactoryMock())); | 203 new syncer::SyncErrorFactoryMock())); |
203 | 204 |
204 content::WindowedNotificationObserver( | 205 content::WindowedNotificationObserver( |
205 extensions::NOTIFICATION_CRX_INSTALLER_DONE, | 206 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
206 content::NotificationService::AllSources()).Wait(); | 207 content::NotificationService::AllSources()).Wait(); |
207 | 208 |
208 EXPECT_TRUE(service_->GetInstalledExtension(kStandaloneAppId)); | 209 EXPECT_TRUE(service_->GetInstalledExtension(kStandaloneAppId)); |
209 } | 210 } |
210 | 211 |
211 } // namespace extensions | 212 } // namespace extensions |
OLD | NEW |