diff options
-rw-r--r-- | chrome/browser/extensions/extension_install_ui_browsertest.cc | 14 |
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( |