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

Unified Diff: chrome/browser/chromeos/drive/drive_integration_service_unittest.cc

Issue 218903005: Make push messaging not create InvalidationService for login and guest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make code resilient against tests that do not create the Default profile first. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/profiles/profile_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/drive_integration_service_unittest.cc
diff --git a/chrome/browser/chromeos/drive/drive_integration_service_unittest.cc b/chrome/browser/chromeos/drive/drive_integration_service_unittest.cc
index 14f301ad46da0e82ed5dafc1ec47b49a57c02e9a..dc37a109f584addc6559e38a41aa4de8df8a0af8 100644
--- a/chrome/browser/chromeos/drive/drive_integration_service_unittest.cc
+++ b/chrome/browser/chromeos/drive/drive_integration_service_unittest.cc
@@ -7,24 +7,41 @@
#include "chrome/browser/chromeos/drive/dummy_file_system.h"
#include "chrome/browser/chromeos/drive/test_util.h"
#include "chrome/browser/drive/dummy_drive_service.h"
+#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
+#include "chrome/test/base/testing_profile_manager.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace drive {
+namespace{
+const char kTestProfileName[] = "test-profile";
+}
+
class DriveIntegrationServiceTest : public testing::Test {
public:
+ DriveIntegrationServiceTest()
+ : profile_manager_(TestingBrowserProcess::GetGlobal()) {}
+
virtual void SetUp() OVERRIDE {
- profile_.reset(new TestingProfile);
+ ASSERT_TRUE(profile_manager_.SetUp());
integration_service_.reset(new DriveIntegrationService(
- profile_.get(), NULL, new DummyDriveService, std::string(),
- base::FilePath(), new DummyFileSystem));
+ profile_manager_.CreateTestingProfile(kTestProfileName),
+ NULL,
+ new DummyDriveService,
+ std::string(),
+ base::FilePath(),
+ new DummyFileSystem));
}
protected:
content::TestBrowserThreadBundle thread_bundle_;
- scoped_ptr<TestingProfile> profile_;
+ // DriveIntegrationService depends on DriveNotificationManager which depends
+ // on InvalidationService. On Chrome OS, the InvalidationServiceFactory
+ // uses chromeos::ProfileHelper, which needs the ProfileManager or a
+ // TestProfileManager to be running.
+ TestingProfileManager profile_manager_;
scoped_ptr<DriveIntegrationService> integration_service_;
};
« no previous file with comments | « no previous file | chrome/browser/chromeos/profiles/profile_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698