diff options
author | tessamac@chromium.org <tessamac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-07 20:56:37 +0000 |
---|---|---|
committer | tessamac@chromium.org <tessamac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-07 20:56:37 +0000 |
commit | 19a906b8dce8dc3cc7a68673f6ca671808e054fc (patch) | |
tree | 7e310d530df9874680232c9b50b997460f9dc742 /chrome/browser/extensions/extension_install_ui_browsertest.cc | |
parent | 752fd3bfca32211ce85d57508bf7f8b0dd839a79 (diff) | |
download | chromium_src-19a906b8dce8dc3cc7a68673f6ca671808e054fc.zip chromium_src-19a906b8dce8dc3cc7a68673f6ca671808e054fc.tar.gz chromium_src-19a906b8dce8dc3cc7a68673f6ca671808e054fc.tar.bz2 |
New test checks that theme install undo reverts to previous theme.
Test is for the code change in revision 70686 and to help ensure the bug 65967 doesn't reappear.
(Also remove dependency on crx files.)
BUG=65867
TEST=browser_tests and try bots
Review URL: http://codereview.chromium.org/6269020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74024 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_install_ui_browsertest.cc')
-rw-r--r-- | chrome/browser/extensions/extension_install_ui_browsertest.cc | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/chrome/browser/extensions/extension_install_ui_browsertest.cc b/chrome/browser/extensions/extension_install_ui_browsertest.cc index 465b189..327a923 100644 --- a/chrome/browser/extensions/extension_install_ui_browsertest.cc +++ b/chrome/browser/extensions/extension_install_ui_browsertest.cc @@ -13,9 +13,6 @@ namespace { -// Theme ID used for testing. -const char* const theme_crx = "iamefpfkojoapidjnbafmgkgncegbkad"; - } // namespace class ExtensionInstallUIBrowserTest : public ExtensionBrowserTest { @@ -37,11 +34,11 @@ class ExtensionInstallUIBrowserTest : public ExtensionBrowserTest { IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, TestThemeInstallUndoResetsToDefault) { // Install theme once and undo to verify we go back to default theme. - FilePath theme_path = test_data_dir_.AppendASCII("theme.crx"); - ASSERT_TRUE(InstallExtensionWithUI(theme_path, 1)); + FilePath theme_crx = PackExtension(test_data_dir_.AppendASCII("theme")); + ASSERT_TRUE(InstallExtensionWithUI(theme_crx, 1)); const Extension* theme = browser()->profile()->GetTheme(); ASSERT_TRUE(theme); - ASSERT_EQ(theme_crx, theme->id()); + std::string theme_id = theme->id(); VerifyThemeInfoBarAndUndoInstall(); ASSERT_EQ(NULL, browser()->profile()->GetTheme()); @@ -49,19 +46,40 @@ IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, // We set the |expected_change| to zero in these 'InstallExtensionWithUI' // calls since the theme has already been installed above and this is an // overinstall to set the active theme. - ASSERT_TRUE(InstallExtensionWithUI(theme_path, 0)); + ASSERT_TRUE(InstallExtensionWithUI(theme_crx, 0)); theme = browser()->profile()->GetTheme(); ASSERT_TRUE(theme); - ASSERT_EQ(theme_crx, theme->id()); - ASSERT_TRUE(InstallExtensionWithUI(theme_path, 0)); + ASSERT_EQ(theme_id, theme->id()); + ASSERT_TRUE(InstallExtensionWithUI(theme_crx, 0)); theme = browser()->profile()->GetTheme(); ASSERT_TRUE(theme); - ASSERT_EQ(theme_crx, theme->id()); + ASSERT_EQ(theme_id, theme->id()); VerifyThemeInfoBarAndUndoInstall(); ASSERT_EQ(NULL, browser()->profile()->GetTheme()); } IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, + TestThemeInstallUndoResetsToPreviousTheme) { + // Install first theme. + FilePath theme_path = test_data_dir_.AppendASCII("theme"); + ASSERT_TRUE(InstallExtensionWithUI(theme_path, 1)); + const Extension* theme = browser()->profile()->GetTheme(); + ASSERT_TRUE(theme); + std::string theme_id = theme->id(); + + // Then install second theme. + FilePath theme_path2 = test_data_dir_.AppendASCII("theme2"); + ASSERT_TRUE(InstallExtensionWithUI(theme_path2, 1)); + const Extension* theme2 = browser()->profile()->GetTheme(); + ASSERT_TRUE(theme2); + EXPECT_FALSE(theme_id == theme2->id()); + + // Undo second theme will revert to first theme. + VerifyThemeInfoBarAndUndoInstall(); + EXPECT_EQ(theme, browser()->profile()->GetTheme()); +} + +IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, AppInstallConfirmation) { int num_tabs = browser()->tab_count(); |