summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-01 18:24:41 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-01 18:24:41 +0000
commitd659132ecf7a4948bc74593da6a62bf094bbf52b (patch)
treeee09af03cfa7a8d94112768cec109f5af6ab4b11 /chrome
parent3bf03aff50e1881229c3b4e28591da4959b9ea07 (diff)
downloadchromium_src-d659132ecf7a4948bc74593da6a62bf094bbf52b.zip
chromium_src-d659132ecf7a4948bc74593da6a62bf094bbf52b.tar.gz
chromium_src-d659132ecf7a4948bc74593da6a62bf094bbf52b.tar.bz2
Some UI tests would fail on some boxes as these tests have specific expectations in term of how many and what kind of info-bars are showing, and the default browser check would add an extra info-bar.
This CL adds a switch that disables the default browser check on start-up and makes the UI tests specify that switch. BUG=13064 TEST=Run the UI tests. Review URL: http://codereview.chromium.org/112081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17336 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser_init.cc3
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h2
-rw-r--r--chrome/test/ui/ui_test.cc4
4 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index 59258e2..c8d3d5d 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -419,7 +419,8 @@ bool BrowserInit::LaunchWithProfile::Launch(Profile* profile,
OpenURLsInBrowser(browser, process_startup, urls_to_open);
}
// Check whether we are the default browser.
- CheckDefaultBrowser(profile);
+ if (!command_line_.HasSwitch(switches::kNoDefaultBrowserCheck))
+ CheckDefaultBrowser(profile);
} else {
RecordLaunchModeHistogram(LM_AS_WEBAPP);
}
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index ffe8d9c..622893e 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -477,4 +477,8 @@ const wchar_t kForceFieldTestNameAndValue[] = L"force-fieldtest";
// can be a file path, in which case the file will be used as the new tab page.
const wchar_t kNewNewTabPage[] = L"new-new-tab-page";
+// Disables the default browser check. Useful for UI/browser tests where we want
+// to avoid having the default browser info-bar displayed.
+const wchar_t kNoDefaultBrowserCheck[] = L"no-default-browser-check";
+
} // namespace switches
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index e7adab0..5a5c6cb 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -179,6 +179,8 @@ extern const wchar_t kForceFieldTestNameAndValue[];
extern const wchar_t kNewNewTabPage[];
+extern const wchar_t kNoDefaultBrowserCheck[];
+
} // namespace switches
#endif // CHROME_COMMON_CHROME_SWITCHES_H_
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index 1b15116..c6b1574 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -243,6 +243,10 @@ void UITest::LaunchBrowser(const CommandLine& arguments, bool clear_profile) {
// No first-run dialogs, please.
command_line.AppendSwitch(switches::kNoFirstRun);
+ // No default browser check, it would create an info-bar (if we are not the
+ // default browser) that could conflicts with some tests expectations.
+ command_line.AppendSwitch(switches::kNoDefaultBrowserCheck);
+
// We need cookies on file:// for things like the page cycler.
if (enable_file_cookies_)
command_line.AppendSwitch(switches::kEnableFileCookies);