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

Side by Side Diff: chrome/browser/sync/test/integration/sync_test.cc

Issue 2010463002: Mocker for OSCrypt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
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/test/integration/sync_test.h" 5 #include "chrome/browser/sync/test/integration/sync_test.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #include "chrome/test/base/ui_test_utils.h" 59 #include "chrome/test/base/ui_test_utils.h"
60 #include "components/bookmarks/test/bookmark_test_helpers.h" 60 #include "components/bookmarks/test/bookmark_test_helpers.h"
61 #include "components/browser_sync/browser/profile_sync_service.h" 61 #include "components/browser_sync/browser/profile_sync_service.h"
62 #include "components/google/core/browser/google_url_tracker.h" 62 #include "components/google/core/browser/google_url_tracker.h"
63 #include "components/invalidation/impl/invalidation_switches.h" 63 #include "components/invalidation/impl/invalidation_switches.h"
64 #include "components/invalidation/impl/p2p_invalidation_service.h" 64 #include "components/invalidation/impl/p2p_invalidation_service.h"
65 #include "components/invalidation/impl/p2p_invalidator.h" 65 #include "components/invalidation/impl/p2p_invalidator.h"
66 #include "components/invalidation/impl/profile_invalidation_provider.h" 66 #include "components/invalidation/impl/profile_invalidation_provider.h"
67 #include "components/invalidation/public/invalidation_service.h" 67 #include "components/invalidation/public/invalidation_service.h"
68 #include "components/keyed_service/core/keyed_service.h" 68 #include "components/keyed_service/core/keyed_service.h"
69 #include "components/os_crypt/os_crypt.h" 69 #include "components/os_crypt/os_crypt_mocker.h"
70 #include "components/search_engines/template_url_service.h" 70 #include "components/search_engines/template_url_service.h"
71 #include "components/signin/core/browser/profile_identity_provider.h" 71 #include "components/signin/core/browser/profile_identity_provider.h"
72 #include "components/signin/core/browser/signin_manager.h" 72 #include "components/signin/core/browser/signin_manager.h"
73 #include "components/sync_driver/invalidation_helper.h" 73 #include "components/sync_driver/invalidation_helper.h"
74 #include "components/sync_driver/sync_driver_switches.h" 74 #include "components/sync_driver/sync_driver_switches.h"
75 #include "content/public/browser/navigation_entry.h" 75 #include "content/public/browser/navigation_entry.h"
76 #include "content/public/browser/notification_service.h" 76 #include "content/public/browser/notification_service.h"
77 #include "content/public/browser/web_contents.h" 77 #include "content/public/browser/web_contents.h"
78 #include "content/public/test/test_browser_thread.h" 78 #include "content/public/test/test_browser_thread.h"
79 #include "google_apis/gaia/gaia_urls.h" 79 #include "google_apis/gaia/gaia_urls.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // Decide on password to use. 255 // Decide on password to use.
256 password_ = cl->HasSwitch(switches::kSyncPasswordForTest) 256 password_ = cl->HasSwitch(switches::kSyncPasswordForTest)
257 ? cl->GetSwitchValueASCII(switches::kSyncPasswordForTest) 257 ? cl->GetSwitchValueASCII(switches::kSyncPasswordForTest)
258 : "password"; 258 : "password";
259 } 259 }
260 260
261 if (username_.empty() || password_.empty()) 261 if (username_.empty() || password_.empty())
262 LOG(FATAL) << "Cannot run sync tests without GAIA credentials."; 262 LOG(FATAL) << "Cannot run sync tests without GAIA credentials.";
263 263
264 // Mock the Mac Keychain service. The real Keychain can block on user input. 264 // Mock the Mac Keychain service. The real Keychain can block on user input.
265 #if defined(OS_MACOSX) 265 OSCryptMocker::SetUpWithSingleton();
vabr (Chromium) 2016/05/24 13:33:44 Missing OSCryptMocker::TearDown?
cfroussios 2016/05/25 13:13:09 Done.
266 OSCrypt::UseMockKeychain(true);
267 #endif
268 266
269 // Start up a sync test server if one is needed and setup mock gaia responses. 267 // Start up a sync test server if one is needed and setup mock gaia responses.
270 // Note: This must be done prior to the call to SetupClients() because we want 268 // Note: This must be done prior to the call to SetupClients() because we want
271 // the mock gaia responses to be available before GaiaUrls is initialized. 269 // the mock gaia responses to be available before GaiaUrls is initialized.
272 SetUpTestServerIfRequired(); 270 SetUpTestServerIfRequired();
273 271
274 // Yield control back to the InProcessBrowserTest framework. 272 // Yield control back to the InProcessBrowserTest framework.
275 InProcessBrowserTest::SetUp(); 273 InProcessBrowserTest::SetUp();
276 } 274 }
277 275
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 1127
1130 void SyncTest::TriggerSyncForModelTypes(int index, 1128 void SyncTest::TriggerSyncForModelTypes(int index,
1131 syncer::ModelTypeSet model_types) { 1129 syncer::ModelTypeSet model_types) {
1132 GetSyncService(index)->TriggerRefresh(model_types); 1130 GetSyncService(index)->TriggerRefresh(model_types);
1133 } 1131 }
1134 1132
1135 void SyncTest::SetPreexistingPreferencesFileContents( 1133 void SyncTest::SetPreexistingPreferencesFileContents(
1136 const std::string& contents) { 1134 const std::string& contents) {
1137 preexisting_preferences_file_contents_ = contents; 1135 preexisting_preferences_file_contents_ = contents;
1138 } 1136 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698