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

Side by Side Diff: chrome/browser/themes/theme_service_unittest.cc

Issue 284103002: Replace "external_install" boolean parameter with explicit enumeration in ExtensionUninstall method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/themes/theme_service.h" 5 #include "chrome/browser/themes/theme_service.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/extensions/extension_service_unittest.h" 10 #include "chrome/browser/extensions/extension_service_unittest.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // Let the ThemeService uninstall unused themes. 111 // Let the ThemeService uninstall unused themes.
112 base::MessageLoop::current()->RunUntilIdle(); 112 base::MessageLoop::current()->RunUntilIdle();
113 113
114 base::ScopedTempDir temp_dir; 114 base::ScopedTempDir temp_dir;
115 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 115 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
116 const std::string& extension_id = LoadUnpackedThemeAt(temp_dir.path()); 116 const std::string& extension_id = LoadUnpackedThemeAt(temp_dir.path());
117 EXPECT_FALSE(theme_service->UsingDefaultTheme()); 117 EXPECT_FALSE(theme_service->UsingDefaultTheme());
118 EXPECT_EQ(extension_id, theme_service->GetThemeID()); 118 EXPECT_EQ(extension_id, theme_service->GetThemeID());
119 119
120 // Now uninstall the extension, should revert to the default theme. 120 // Now uninstall the extension, should revert to the default theme.
121 service_->UninstallExtension(extension_id, false, NULL); 121 service_->UninstallExtension(
122 extension_id, ExtensionService::kUninstallReasonDefault, NULL);
122 EXPECT_TRUE(theme_service->UsingDefaultTheme()); 123 EXPECT_TRUE(theme_service->UsingDefaultTheme());
123 } 124 }
124 125
125 // Test that a theme extension is disabled when not in use. A theme may be 126 // Test that a theme extension is disabled when not in use. A theme may be
126 // installed but not in use if it there is an infobar to revert to the previous 127 // installed but not in use if it there is an infobar to revert to the previous
127 // theme. 128 // theme.
128 TEST_F(ThemeServiceTest, DisableUnusedTheme) { 129 TEST_F(ThemeServiceTest, DisableUnusedTheme) {
129 ThemeService* theme_service = 130 ThemeService* theme_service =
130 ThemeServiceFactory::GetForProfile(profile_.get()); 131 ThemeServiceFactory::GetForProfile(profile_.get());
131 theme_service->UseDefaultTheme(); 132 theme_service->UseDefaultTheme();
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 ThemeServiceFactory::GetForProfile(profile_.get()); 261 ThemeServiceFactory::GetForProfile(profile_.get());
261 theme_service->UseDefaultTheme(); 262 theme_service->UseDefaultTheme();
262 EXPECT_TRUE(theme_service->UsingDefaultTheme()); 263 EXPECT_TRUE(theme_service->UsingDefaultTheme());
263 EXPECT_TRUE(get_theme_supplier(theme_service)); 264 EXPECT_TRUE(get_theme_supplier(theme_service));
264 EXPECT_EQ(get_theme_supplier(theme_service)->get_theme_type(), 265 EXPECT_EQ(get_theme_supplier(theme_service)->get_theme_type(),
265 CustomThemeSupplier::MANAGED_USER_THEME); 266 CustomThemeSupplier::MANAGED_USER_THEME);
266 } 267 }
267 #endif 268 #endif
268 269
269 }; // namespace theme_service_internal 270 }; // namespace theme_service_internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698