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

Unified Diff: chrome/browser/profiles/profile_dependency_manager_unittest.cc

Issue 6813116: Revert 81277 - Profile shouldn't own DesktopNotificationService.DesktopNotificationService is now... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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 | « chrome/browser/profiles/profile.cc ('k') | chrome/browser/profiles/profile_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_dependency_manager_unittest.cc
===================================================================
--- chrome/browser/profiles/profile_dependency_manager_unittest.cc (revision 81278)
+++ chrome/browser/profiles/profile_dependency_manager_unittest.cc (working copy)
@@ -6,6 +6,7 @@
#include "chrome/browser/profiles/profile_dependency_manager.h"
#include "chrome/browser/profiles/profile_keyed_service_factory.h"
+#include "chrome/test/testing_profile.h"
class ProfileDependencyManagerUnittests : public ::testing::Test {
protected:
@@ -21,6 +22,11 @@
child->DependsOn(parent);
}
+ void CreateAndDestroyTestProfile() {
+ TestingProfile profile;
+ profile.SetProfileDependencyManager(&dependency_manager_);
+ }
+
ProfileDependencyManager* manager() { return &dependency_manager_; }
std::vector<std::string>* shutdown_order() { return &shutdown_order_; }
@@ -60,7 +66,7 @@
TEST_F(ProfileDependencyManagerUnittests, SingleCase) {
TestService service("service", shutdown_order(), manager());
- manager()->DestroyProfileServices(NULL);
+ CreateAndDestroyTestProfile();
ASSERT_EQ(1U, shutdown_order()->size());
EXPECT_STREQ("service", (*shutdown_order())[0].c_str());
@@ -72,7 +78,7 @@
TestService child("child", shutdown_order(), manager());
DependOn(&child, &parent);
- manager()->DestroyProfileServices(NULL);
+ CreateAndDestroyTestProfile();
ASSERT_EQ(2U, shutdown_order()->size());
EXPECT_STREQ("child", (*shutdown_order())[0].c_str());
@@ -87,7 +93,7 @@
DependOn(&child1, &parent);
DependOn(&child2, &parent);
- manager()->DestroyProfileServices(NULL);
+ CreateAndDestroyTestProfile();
ASSERT_EQ(3U, shutdown_order()->size());
EXPECT_STREQ("child2", (*shutdown_order())[0].c_str());
@@ -110,7 +116,7 @@
TestService child_of_2("child_of_2", shutdown_order(), manager());
DependOn(&child_of_2, &parent2);
- manager()->DestroyProfileServices(NULL);
+ CreateAndDestroyTestProfile();
ASSERT_EQ(5U, shutdown_order()->size());
EXPECT_STREQ("child_of_2", (*shutdown_order())[0].c_str());
@@ -134,7 +140,7 @@
DependOn(&bottom, &middle_row_1);
DependOn(&bottom, &middle_row_2);
- manager()->DestroyProfileServices(NULL);
+ CreateAndDestroyTestProfile();
ASSERT_EQ(4U, shutdown_order()->size());
EXPECT_STREQ("bottom", (*shutdown_order())[0].c_str());
@@ -167,7 +173,7 @@
DependOn(&bottom, &specialized_service);
DependOn(&bottom, &other_intermediary);
- manager()->DestroyProfileServices(NULL);
+ CreateAndDestroyTestProfile();
ASSERT_EQ(6U, shutdown_order()->size());
EXPECT_STREQ("bottom", (*shutdown_order())[0].c_str());
« no previous file with comments | « chrome/browser/profiles/profile.cc ('k') | chrome/browser/profiles/profile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698