src/chrome/browser/themes/theme_service_unittest.cc
// Installs then uninstalls a theme and makes sure that the ThemeService
// reverts to the default theme after the uninstall.
Installs then uninstalls a theme and makes sure that the ThemeService
reverts to the default theme after the uninstall.
Installs then uninstalls a theme and makes sure that the ThemeService reverts to the default theme after the uninstall .
TEST_F(ThemeServiceTest, ThemeInstallUninstall) {
  base::ScopedTempDir temp_dir;
  ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
  ThemeService* theme_service =
      ThemeServiceFactory::GetForProfile(profile_.get());
  theme_service->UseDefaultTheme();
  scoped_refptr<extensions::Extension> extension =
      MakeThemeExtension(temp_dir.path());
  service_->FinishInstallationForTest(extension);
  MessageLoop::current()->RunUntilIdle();
  EXPECT_FALSE(theme_service->UsingDefaultTheme());
  EXPECT_EQ(extension->id(), theme_service->GetThemeID());
  service_->UnloadExtension(extension->id(),
                            extension_misc::UNLOAD_REASON_UNINSTALL);
  EXPECT_TRUE(theme_service->UsingDefaultTheme());
}
TEST_F ( ThemeServiceTest , ThemeInstallUninstall ) { base :: ScopedTempDir temp_dir ; ASSERT_TRUE ( temp_dir . CreateUniqueTempDir ( ) ) ; ThemeService * theme_service = ThemeServiceFactory :: GetForProfile ( profile_ . get ( ) ) ; theme_service -> UseDefaultTheme ( ) ; scoped_refptr < extensions :: Extension > extension = MakeThemeExtension ( temp_dir . path ( ) ) ; service_ -> FinishInstallationForTest ( extension ) ; MessageLoop :: current ( ) -> RunUntilIdle ( ) ; EXPECT_FALSE ( theme_service -> UsingDefaultTheme ( ) ) ; EXPECT_EQ ( extension -> id ( ) , theme_service -> GetThemeID ( ) ) ; service_ -> UnloadExtension ( extension -> id ( ) , extension_misc :: UNLOAD_REASON_UNINSTALL ) ; EXPECT_TRUE ( theme_service -> UsingDefaultTheme ( ) ) ; }
Installs then uninstalls a theme and makes sure that the ThemeService
reverts to the default theme after the uninstall.
Installs then uninstalls a theme and makes sure that the ThemeService reverts to the default theme after the uninstall .
// Let ThemeService finish creating the theme pack. // Now unload the extension, should revert to the default theme.