Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions/extension_browsertest.h" | 5 #include "chrome/browser/extensions/extension_browsertest.h" |
| 6 #include "chrome/browser/extensions/extension_service.h" | 6 #include "chrome/browser/extensions/extension_service.h" |
| 7 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" | 7 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" | 9 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 ASSERT_TRUE(tab_contents); | 26 ASSERT_TRUE(tab_contents); |
| 27 ASSERT_EQ(1, tab_contents->infobar_delegate_count()); | 27 ASSERT_EQ(1, tab_contents->infobar_delegate_count()); |
| 28 ThemeInstalledInfoBarDelegate* delegate = tab_contents-> | 28 ThemeInstalledInfoBarDelegate* delegate = tab_contents-> |
| 29 GetInfoBarDelegateAt(0)->AsThemePreviewInfobarDelegate(); | 29 GetInfoBarDelegateAt(0)->AsThemePreviewInfobarDelegate(); |
| 30 ASSERT_TRUE(delegate); | 30 ASSERT_TRUE(delegate); |
| 31 delegate->Cancel(); | 31 delegate->Cancel(); |
| 32 ASSERT_EQ(0, tab_contents->infobar_delegate_count()); | 32 ASSERT_EQ(0, tab_contents->infobar_delegate_count()); |
| 33 } | 33 } |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // Crashy, http://crbug.com/44548. | 36 // Crashy, http://crbug.com/44548. |
|
Paweł Hajdan Jr.
2011/01/21 09:13:44
nit: Please also remove the comment.
Tessa MacDuff
2011/01/21 21:33:02
Done.
| |
| 37 IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, | 37 IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, |
| 38 DISABLED_TestThemeInstallUndoResetsToDefault) { | 38 TestThemeInstallUndoResetsToDefault) { |
| 39 // Install theme once and undo to verify we go back to default theme. | 39 // Install theme once and undo to verify we go back to default theme. |
| 40 FilePath theme_path = test_data_dir_.AppendASCII("theme.crx"); | 40 FilePath theme_path = test_data_dir_.AppendASCII("theme.crx"); |
| 41 ASSERT_TRUE(InstallExtensionWithUI(theme_path, 1)); | 41 ASSERT_TRUE(InstallExtensionWithUI(theme_path, 1)); |
| 42 const Extension* theme = browser()->profile()->GetTheme(); | 42 const Extension* theme = browser()->profile()->GetTheme(); |
| 43 ASSERT_TRUE(theme); | 43 ASSERT_TRUE(theme); |
| 44 ASSERT_EQ(theme_crx, theme->id()); | 44 ASSERT_EQ(theme_crx, theme->id()); |
| 45 VerifyThemeInfoBarAndUndoInstall(); | 45 VerifyThemeInfoBarAndUndoInstall(); |
| 46 ASSERT_EQ(NULL, browser()->profile()->GetTheme()); | 46 ASSERT_EQ(NULL, browser()->profile()->GetTheme()); |
| 47 | 47 |
| 48 // Set the same theme twice and undo to verify we go back to default theme. | 48 // Set the same theme twice and undo to verify we go back to default theme. |
| 49 // We set the |expected_change| to zero in these 'InstallExtensionWithUI' | 49 // We set the |expected_change| to zero in these 'InstallExtensionWithUI' |
| 50 // calls since the theme has already been installed above and this is an | 50 // calls since the theme has already been installed above and this is an |
| 51 // overinstall to set the active theme. | 51 // overinstall to set the active theme. |
| 52 ASSERT_TRUE(InstallExtensionWithUI(theme_path, 0)); | 52 ASSERT_TRUE(InstallExtensionWithUI(theme_path, 0)); |
| 53 theme = browser()->profile()->GetTheme(); | 53 theme = browser()->profile()->GetTheme(); |
| 54 ASSERT_TRUE(theme); | 54 ASSERT_TRUE(theme); |
| 55 ASSERT_EQ(theme_crx, theme->id()); | 55 ASSERT_EQ(theme_crx, theme->id()); |
| 56 ASSERT_TRUE(InstallExtensionWithUI(theme_path, 0)); | 56 ASSERT_TRUE(InstallExtensionWithUI(theme_path, 0)); |
| 57 theme = browser()->profile()->GetTheme(); | 57 theme = browser()->profile()->GetTheme(); |
| 58 ASSERT_TRUE(theme); | 58 ASSERT_TRUE(theme); |
| 59 ASSERT_EQ(theme_crx, theme->id()); | 59 ASSERT_EQ(theme_crx, theme->id()); |
| 60 VerifyThemeInfoBarAndUndoInstall(); | 60 VerifyThemeInfoBarAndUndoInstall(); |
| 61 ASSERT_EQ(NULL, browser()->profile()->GetTheme()); | 61 ASSERT_EQ(NULL, browser()->profile()->GetTheme()); |
| 62 } | 62 } |
| OLD | NEW |