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

Unified Diff: chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc

Issue 77773002: Ensure the ExtensionSystem is ready before initializing an ExtensionAppModelBuilder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests 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
Index: chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
diff --git a/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc b/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
index 53c9200a66368c3877334dcc7621e733140c3763..df543d7ec07d7c39f927385931c0bbebdc54099f 100644
--- a/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
+++ b/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
@@ -138,6 +138,8 @@ class ExtensionAppModelBuilderTest : public ExtensionServiceTestBase {
scoped_ptr<TestAppListControllerDelegate> controller_;
scoped_ptr<ExtensionAppModelBuilder> builder_;
+ base::ScopedTempDir second_profile_temp_dir_;
+
private:
DISALLOW_COPY_AND_ASSIGN(ExtensionAppModelBuilderTest);
};
@@ -317,8 +319,14 @@ TEST_F(ExtensionAppModelBuilderTest, SwitchProfile) {
EXPECT_EQ(kDefaultAppCount, model_->item_list()->item_count());
// Switch to a profile with no apps, ensure all apps are removed.
- TestingProfile::Builder profile_builder;
- scoped_ptr<TestingProfile> profile2(profile_builder.Build());
+ scoped_ptr<TestingProfile> profile2;
+ ExtensionService* service_for_second_profile;
+ ExtensionServiceInitParams params =
+ CreateDefaultInitParamsInTempDir(&second_profile_temp_dir_);
+ InitializeExtensionServiceForProfile(params,
+ &profile2,
+ &service_for_second_profile);
+
builder_->SwitchProfile(profile2.get());
EXPECT_EQ(0u, model_->item_list()->item_count());

Powered by Google App Engine
This is Rietveld 408576698