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

Unified Diff: chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api_unittest.cc

Issue 59793008: sync: don't allow NULL profile in ProfileSyncService and friends (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/invalidation/invalidator_storage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api_unittest.cc
diff --git a/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api_unittest.cc b/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api_unittest.cc
index 838fc6a82deb14eef01d277563d569546737d9f9..580100ddbdd2ead185b40323593a144ea10586dd 100644
--- a/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api_unittest.cc
+++ b/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api_unittest.cc
@@ -31,7 +31,8 @@ namespace extensions {
namespace utils = extension_function_test_utils;
TEST(SignedInDevicesAPITest, GetSignedInDevices) {
- ProfileSyncServiceMock pss_mock;
+ TestingProfile profile;
+ ProfileSyncServiceMock pss_mock(&profile);
base::MessageLoop message_loop_;
TestExtensionPrefs extension_prefs(
message_loop_.message_loop_proxy().get());
@@ -107,14 +108,17 @@ TEST(SignedInDevicesAPITest, GetSignedInDevices) {
class ProfileSyncServiceMockForExtensionTests:
public ProfileSyncServiceMock {
public:
- ProfileSyncServiceMockForExtensionTests() {}
+ explicit ProfileSyncServiceMockForExtensionTests(Profile* p)
+ : ProfileSyncServiceMock(p) {}
~ProfileSyncServiceMockForExtensionTests() {}
+
MOCK_METHOD0(Shutdown, void());
};
BrowserContextKeyedService* CreateProfileSyncServiceMock(
content::BrowserContext* profile) {
- return new ProfileSyncServiceMockForExtensionTests();
+ return new ProfileSyncServiceMockForExtensionTests(
+ Profile::FromBrowserContext(profile));
}
class ExtensionSignedInDevicesTest : public BrowserWithTestWindowTest {
« no previous file with comments | « no previous file | chrome/browser/invalidation/invalidator_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698