summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_install_ui_browsertest.cc
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-13 21:28:10 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-13 21:28:10 +0000
commit2d9f3edc3c3d7ab01e5462c03d410134b560468c (patch)
tree9a6db23c9b8e5178e08fb49e1386b7c347dee155 /chrome/browser/extensions/extension_install_ui_browsertest.cc
parent7636b11f41df2b8a67fb8a7723620523d40deade (diff)
downloadchromium_src-2d9f3edc3c3d7ab01e5462c03d410134b560468c.zip
chromium_src-2d9f3edc3c3d7ab01e5462c03d410134b560468c.tar.gz
chromium_src-2d9f3edc3c3d7ab01e5462c03d410134b560468c.tar.bz2
Close all infobars before testing the count, otherwise the count will be wrong.
BUG=none TEST=ExtensionInstallUIBrowserTest.* on 10.5 TBR=aa@chromium.org Review URL: https://chromiumcodereview.appspot.com/10539142 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141979 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.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_install_ui_browsertest.cc b/chrome/browser/extensions/extension_install_ui_browsertest.cc
index e90fb96..cd67eb9 100644
--- a/chrome/browser/extensions/extension_install_ui_browsertest.cc
+++ b/chrome/browser/extensions/extension_install_ui_browsertest.cc
@@ -21,6 +21,16 @@ using extensions::Extension;
class ExtensionInstallUIBrowserTest : public ExtensionBrowserTest {
public:
+ // The test counts infobars, so make sure nothing else has opened one.
+ void CloseAllInfobars() {
+ TabContents* tab = browser()->GetActiveTabContents();
+ ASSERT_TRUE(tab);
+
+ InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper();
+ while (infobar_helper->infobar_count() > 0)
+ infobar_helper->RemoveInfoBar(infobar_helper->GetInfoBarDelegateAt(0));
+ }
+
// Checks that a theme info bar is currently visible and issues an undo to
// revert to the previous theme.
void VerifyThemeInfoBarAndUndoInstall() {
@@ -50,6 +60,8 @@ class ExtensionInstallUIBrowserTest : public ExtensionBrowserTest {
IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest,
MAYBE_TestThemeInstallUndoResetsToDefault) {
+ CloseAllInfobars();
+
// Install theme once and undo to verify we go back to default theme.
FilePath theme_crx = PackExtension(test_data_dir_.AppendASCII("theme"));
ASSERT_TRUE(InstallExtensionWithUIAutoConfirm(
@@ -80,6 +92,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest,
IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest,
TestThemeInstallUndoResetsToPreviousTheme) {
+ CloseAllInfobars();
+
// Install first theme.
FilePath theme_path = test_data_dir_.AppendASCII("theme");
ASSERT_TRUE(InstallExtensionWithUIAutoConfirm(