diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser_main.cc | 8 | ||||
-rw-r--r-- | chrome/browser/first_run_win.cc | 5 | ||||
-rw-r--r-- | chrome/browser/sanity_uitest.cc | 22 |
3 files changed, 31 insertions, 4 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 57dd2d9..ccb90c1 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -611,19 +611,21 @@ int BrowserMain(const MainFunctionParams& parameters) { gtk_util::SetDefaultWindowIcon(); #endif -#if defined(OS_WIN) - // This is experimental code. See first_run_win.cc for more info. std::string try_chrome = parsed_command_line.GetSwitchValueASCII(switches::kTryChromeAgain); if (!try_chrome.empty()) { +#if defined(OS_WIN) Upgrade::TryResult answer = Upgrade::ShowTryChromeDialog(StringToInt(try_chrome)); if (answer == Upgrade::TD_NOT_NOW) return ResultCodes::NORMAL_EXIT_CANCEL; if (answer == Upgrade::TD_UNINSTALL_CHROME) return ResultCodes::NORMAL_EXIT_EXP2; +#else + // We don't support retention experiments on Mac or Linux. + return ResultCodes::NORMAL_EXIT; +#endif // defined(OS_WIN) } -#endif // OS_WIN BrowserInit browser_init; diff --git a/chrome/browser/first_run_win.cc b/chrome/browser/first_run_win.cc index 3d2c86a..5a3078f 100644 --- a/chrome/browser/first_run_win.cc +++ b/chrome/browser/first_run_win.cc @@ -936,6 +936,11 @@ class TryChromeDialog : public views::ButtonListener, } // namespace Upgrade::TryResult Upgrade::ShowTryChromeDialog(size_t version) { + if (version > 10000) { + // This is a test value. We want to make sure we exercise + // returning this early. See EarlyReturnTest test harness. + return Upgrade::TD_NOT_NOW; + } TryChromeDialog td; return td.ShowModal(); } diff --git a/chrome/browser/sanity_uitest.cc b/chrome/browser/sanity_uitest.cc index 2eaded0..ab347bb 100644 --- a/chrome/browser/sanity_uitest.cc +++ b/chrome/browser/sanity_uitest.cc @@ -10,6 +10,7 @@ #include "base/basictypes.h" #include "base/file_path.h" #include "base/platform_thread.h" +#include "chrome/common/chrome_switches.h" class GoogleTest : public UITest { protected: @@ -45,5 +46,24 @@ TEST_F(ColumnLayout, Crash) { // Make sure the navigation succeeded. EXPECT_EQ(page_title, GetActiveTabTitle()); - // UIText will check if this crashed. + // UITest will check if this crashed. +} + +// By passing kTryChromeAgain with a magic value > 10000 we cause chrome +// to exit fairly early. This was the cause of crashes. See bug 34799. +class EarlyReturnTest : public UITest { + public: + EarlyReturnTest() { + wait_for_initial_loads_ = false; + // We don't depend on these timeouts, they are set to the minimum so + // the automation server waits the minimun amount possible for the + // handshake that will never come. + set_command_execution_timeout_ms(1); + set_action_timeout_ms(1); + launch_arguments_.AppendSwitchWithValue(switches::kTryChromeAgain, "10001"); + } +}; + +TEST_F(EarlyReturnTest, ToastCrasher) { + // UITest will check if this crashed. } |