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

Unified Diff: chrome/browser/themes/theme_service_browsertest.cc

Issue 2447553003: More pre-MD odds and ends. (Closed)
Patch Set: fix typo Created 4 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/themes/theme_service_browsertest.cc
diff --git a/chrome/browser/themes/theme_service_browsertest.cc b/chrome/browser/themes/theme_service_browsertest.cc
index 8980e9f01bcefbd8d15387715807c6508dfd30e6..d2fcd8500bb0a787d2db37042ec54575ab0fc7ca 100644
--- a/chrome/browser/themes/theme_service_browsertest.cc
+++ b/chrome/browser/themes/theme_service_browsertest.cc
@@ -64,6 +64,14 @@ IN_PROC_BROWSER_TEST_F(ThemeServiceBrowserTest, PRE_ThemeDataPackInvalid) {
theme_provider.GetColor(ThemeProperties::COLOR_TOOLBAR));
EXPECT_NE(base::FilePath(),
profile->GetPrefs()->GetFilePath(prefs::kCurrentThemePackFilename));
+ // Add a vestigial .pak file that should be removed when the new one is
+ // created.
+ // TODO(estade): remove when vestigial .pak file deletion is removed.
+ EXPECT_EQ(
+ 1, base::WriteFile(profile->GetPrefs()
+ ->GetFilePath(prefs::kCurrentThemePackFilename)
+ .AppendASCII("Cached Theme Material Design.pak"),
+ "a", 1));
// Change the theme data pack path to an invalid location such that second
// part of the test is forced to recreate the theme pack when the theme
@@ -81,6 +89,17 @@ IN_PROC_BROWSER_TEST_F(ThemeServiceBrowserTest, ThemeDataPackInvalid) {
EXPECT_TRUE(UsingCustomTheme(*theme_service));
EXPECT_EQ(kThemeToolbarColor,
theme_provider.GetColor(ThemeProperties::COLOR_TOOLBAR));
+
+ // TODO(estade): remove when vestigial .pak file deletion is removed.
+ content::BrowserThread::GetBlockingPool()->FlushForTesting();
+ base::FilePath old_path =
+ browser()
+ ->profile()
+ ->GetPrefs()
+ ->GetFilePath(prefs::kCurrentThemePackFilename)
+ .AppendASCII("Cached Theme Material Design.pak");
+ EXPECT_FALSE(base::PathExists(old_path)) << "File not deleted: "
+ << old_path.value();
}
} // namespace
« no previous file with comments | « chrome/browser/themes/theme_service.cc ('k') | chrome/browser/ui/views/location_bar/page_action_image_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698