Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(731)

Side by Side Diff: chrome/browser/extensions/api/preferences_private/preferences_private_apitest.cc

Issue 367153005: Sync: Refactoring of DEVICE_INFO syncable type - Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed scoped_ptr issue in ProfileSyncService constructor Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/sessions/sessions_apitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/extensions/api/preferences_private/preferences_private_ api.h" 15 #include "chrome/browser/extensions/api/preferences_private/preferences_private_ api.h"
16 #include "chrome/browser/extensions/extension_apitest.h" 16 #include "chrome/browser/extensions/extension_apitest.h"
17 #include "chrome/browser/extensions/extension_function_test_utils.h" 17 #include "chrome/browser/extensions/extension_function_test_utils.h"
18 #include "chrome/browser/extensions/extension_test_message_listener.h" 18 #include "chrome/browser/extensions/extension_test_message_listener.h"
19 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/profiles/profile_manager.h" 20 #include "chrome/browser/profiles/profile_manager.h"
21 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 21 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
22 #include "chrome/browser/sync/profile_sync_components_factory_mock.h"
22 #include "chrome/browser/sync/profile_sync_service.h" 23 #include "chrome/browser/sync/profile_sync_service.h"
23 #include "chrome/browser/sync/profile_sync_service_factory.h" 24 #include "chrome/browser/sync/profile_sync_service_factory.h"
24 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h" 25 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h"
25 #include "chrome/browser/ui/browser.h" 26 #include "chrome/browser/ui/browser.h"
26 #include "chrome/common/chrome_constants.h" 27 #include "chrome/common/chrome_constants.h"
27 #include "chrome/common/chrome_paths.h" 28 #include "chrome/common/chrome_paths.h"
28 #include "chrome/test/base/testing_profile.h" 29 #include "chrome/test/base/testing_profile.h"
29 #include "components/bookmarks/common/bookmark_constants.h" 30 #include "components/bookmarks/common/bookmark_constants.h"
30 #include "components/sync_driver/sync_prefs.h" 31 #include "components/sync_driver/sync_prefs.h"
31 #include "content/public/browser/browser_context.h" 32 #include "content/public/browser/browser_context.h"
32 33
33 #if defined(OS_CHROMEOS) 34 #if defined(OS_CHROMEOS)
34 #include "chromeos/chromeos_switches.h" 35 #include "chromeos/chromeos_switches.h"
35 #endif 36 #endif
36 37
37 using extensions::PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction; 38 using extensions::PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction;
38 39
39 namespace { 40 namespace {
40 41
41 class FakeProfileSyncService : public ProfileSyncService { 42 class FakeProfileSyncService : public ProfileSyncService {
42 public: 43 public:
43 explicit FakeProfileSyncService(Profile* profile) 44 explicit FakeProfileSyncService(Profile* profile)
44 : ProfileSyncService( 45 : ProfileSyncService(
45 NULL, 46 scoped_ptr<ProfileSyncComponentsFactory>(
47 new ProfileSyncComponentsFactoryMock()),
46 profile, 48 profile,
47 make_scoped_ptr<SupervisedUserSigninManagerWrapper>(NULL), 49 make_scoped_ptr<SupervisedUserSigninManagerWrapper>(NULL),
48 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), 50 ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
49 browser_sync::MANUAL_START), 51 browser_sync::MANUAL_START),
50 sync_initialized_(true), 52 sync_initialized_(true),
51 initialized_state_violation_(false) {} 53 initialized_state_violation_(false) {}
52 54
53 virtual ~FakeProfileSyncService() {} 55 virtual ~FakeProfileSyncService() {}
54 56
55 static KeyedService* BuildFakeProfileSyncService( 57 static KeyedService* BuildFakeProfileSyncService(
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 194
193 // Verifies that we wait for the sync service to be ready before checking 195 // Verifies that we wait for the sync service to be ready before checking
194 // encryption status. 196 // encryption status.
195 IN_PROC_BROWSER_TEST_F(PreferencesPrivateApiTest, 197 IN_PROC_BROWSER_TEST_F(PreferencesPrivateApiTest,
196 GetSyncCategoriesWithoutPassphraseAsynchronous) { 198 GetSyncCategoriesWithoutPassphraseAsynchronous) {
197 service_->set_sync_initialized(false); 199 service_->set_sync_initialized(false);
198 TestGetSyncCategoriesWithoutPassphraseFunction(); 200 TestGetSyncCategoriesWithoutPassphraseFunction();
199 } 201 }
200 202
201 } // namespace 203 } // namespace
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/sessions/sessions_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698