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

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

Issue 421193002: Fix ExtensionServiceTest.ClearExtensionData flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use base::DoNothing for empty callbacks Created 6 years, 4 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 | Annotate | Revision Log
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.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // Let the ThemeService uninstall unused themes. 113 // Let the ThemeService uninstall unused themes.
114 base::MessageLoop::current()->RunUntilIdle(); 114 base::MessageLoop::current()->RunUntilIdle();
115 115
116 base::ScopedTempDir temp_dir; 116 base::ScopedTempDir temp_dir;
117 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 117 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
118 const std::string& extension_id = LoadUnpackedThemeAt(temp_dir.path()); 118 const std::string& extension_id = LoadUnpackedThemeAt(temp_dir.path());
119 EXPECT_FALSE(theme_service->UsingDefaultTheme()); 119 EXPECT_FALSE(theme_service->UsingDefaultTheme());
120 EXPECT_EQ(extension_id, theme_service->GetThemeID()); 120 EXPECT_EQ(extension_id, theme_service->GetThemeID());
121 121
122 // Now uninstall the extension, should revert to the default theme. 122 // Now uninstall the extension, should revert to the default theme.
123 service_->UninstallExtension( 123 service_->UninstallExtension(extension_id,
124 extension_id, extensions::UNINSTALL_REASON_FOR_TESTING, NULL); 124 extensions::UNINSTALL_REASON_FOR_TESTING,
125 base::Bind(&base::DoNothing),
126 NULL);
125 EXPECT_TRUE(theme_service->UsingDefaultTheme()); 127 EXPECT_TRUE(theme_service->UsingDefaultTheme());
126 } 128 }
127 129
128 // Test that a theme extension is disabled when not in use. A theme may be 130 // Test that a theme extension is disabled when not in use. A theme may be
129 // installed but not in use if it there is an infobar to revert to the previous 131 // installed but not in use if it there is an infobar to revert to the previous
130 // theme. 132 // theme.
131 TEST_F(ThemeServiceTest, DisableUnusedTheme) { 133 TEST_F(ThemeServiceTest, DisableUnusedTheme) {
132 ThemeService* theme_service = 134 ThemeService* theme_service =
133 ThemeServiceFactory::GetForProfile(profile_.get()); 135 ThemeServiceFactory::GetForProfile(profile_.get());
134 theme_service->UseDefaultTheme(); 136 theme_service->UseDefaultTheme();
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 ThemeServiceFactory::GetForProfile(profile_.get()); 266 ThemeServiceFactory::GetForProfile(profile_.get());
265 theme_service->UseDefaultTheme(); 267 theme_service->UseDefaultTheme();
266 EXPECT_TRUE(theme_service->UsingDefaultTheme()); 268 EXPECT_TRUE(theme_service->UsingDefaultTheme());
267 EXPECT_TRUE(get_theme_supplier(theme_service)); 269 EXPECT_TRUE(get_theme_supplier(theme_service));
268 EXPECT_EQ(get_theme_supplier(theme_service)->get_theme_type(), 270 EXPECT_EQ(get_theme_supplier(theme_service)->get_theme_type(),
269 CustomThemeSupplier::SUPERVISED_USER_THEME); 271 CustomThemeSupplier::SUPERVISED_USER_THEME);
270 } 272 }
271 #endif 273 #endif
272 274
273 }; // namespace theme_service_internal 275 }; // namespace theme_service_internal
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_service.cc ('k') | chrome/browser/ui/app_list/app_list_syncable_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698