Index: chrome/browser/ui/startup/startup_browser_creator_impl.cc |
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
index 125a985e30ff9ea302ea7b7e065a584f98743829..8815e0c50d999844859dac5fdef3e00669c50b2e 100644 |
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
@@ -67,6 +67,7 @@ |
#include "chrome/browser/ui/extensions/app_launch_params.h" |
#include "chrome/browser/ui/extensions/application_launch.h" |
#include "chrome/browser/ui/session_crashed_bubble.h" |
+#include "chrome/browser/ui/startup/automation_infobar_delegate.h" |
#include "chrome/browser/ui/startup/bad_flags_prompt.h" |
#include "chrome/browser/ui/startup/default_browser_prompt.h" |
#include "chrome/browser/ui/startup/google_api_keys_infobar_delegate.h" |
@@ -801,11 +802,19 @@ void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary( |
SessionCrashedInfoBarDelegate::Create(browser); |
} |
+ if (command_line_.HasSwitch(switches::kEnableAutomation)) |
+ AutomationInfoBarDelegate::Create(); |
+ |
// The below info bars are only added to the first profile which is launched. |
// Other profiles might be restoring the browsing sessions asynchronously, |
// so we cannot add the info bars to the focused tabs here. |
+ // |
+ // These info bars are not shown when the browser is being controlled by |
+ // automated tests, so that they don't interfere with tests that assume no |
+ // info bars. |
if (is_process_startup == chrome::startup::IS_PROCESS_STARTUP && |
- !command_line_.HasSwitch(switches::kTestType)) { |
+ !command_line_.HasSwitch(switches::kTestType) && |
+ !command_line_.HasSwitch(switches::kEnableAutomation)) { |
chrome::ShowBadFlagsPrompt(browser); |
GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents( |
browser->tab_strip_model()->GetActiveWebContents())); |