OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/common/chrome_result_codes.h" | 6 #include "chrome/common/chrome_result_codes.h" |
7 #include "chrome/common/chrome_switches.h" | 7 #include "chrome/common/chrome_switches.h" |
8 #include "chrome/test/base/in_process_browser_test.h" | 8 #include "chrome/test/base/in_process_browser_test.h" |
9 | 9 |
10 // Unfortunately, this needs to be Windows only for now. Even though this test | 10 // Unfortunately, this needs to be Windows only for now. Even though this test |
(...skipping 11 matching lines...) Expand all Loading... |
22 // doesn't do anything other than cause Chrome to quit on startup on | 22 // doesn't do anything other than cause Chrome to quit on startup on |
23 // non-Windows) was a cause of crashes (see bug 34799 for example) so | 23 // non-Windows) was a cause of crashes (see bug 34799 for example) so |
24 // this is a useful test of the startup/quick-shutdown cycle. | 24 // this is a useful test of the startup/quick-shutdown cycle. |
25 class TryChromeDialogBrowserTest : public InProcessBrowserTest { | 25 class TryChromeDialogBrowserTest : public InProcessBrowserTest { |
26 public: | 26 public: |
27 TryChromeDialogBrowserTest() { | 27 TryChromeDialogBrowserTest() { |
28 set_expected_exit_code(chrome::RESULT_CODE_NORMAL_EXIT_CANCEL); | 28 set_expected_exit_code(chrome::RESULT_CODE_NORMAL_EXIT_CANCEL); |
29 } | 29 } |
30 | 30 |
31 protected: | 31 protected: |
32 virtual void SetUpCommandLine(base::CommandLine* command_line) { | 32 void SetUpCommandLine(base::CommandLine* command_line) override { |
33 command_line->AppendSwitchASCII(switches::kTryChromeAgain, "10001"); | 33 command_line->AppendSwitchASCII(switches::kTryChromeAgain, "10001"); |
34 } | 34 } |
35 }; | 35 }; |
36 | 36 |
37 // Note to Sheriffs: This test (as you can read about above) simply causes | 37 // Note to Sheriffs: This test (as you can read about above) simply causes |
38 // Chrome to shutdown early, and, as such, has proven to be pretty good at | 38 // Chrome to shutdown early, and, as such, has proven to be pretty good at |
39 // finding problems related to shutdown. Sheriff, before marking this test as | 39 // finding problems related to shutdown. Sheriff, before marking this test as |
40 // disabled, please consider that this test is meant to catch when people | 40 // disabled, please consider that this test is meant to catch when people |
41 // introduce changes that crash Chrome during shutdown and disabling this test | 41 // introduce changes that crash Chrome during shutdown and disabling this test |
42 // and moving on removes a safeguard meant to avoid an even bigger thorny mess | 42 // and moving on removes a safeguard meant to avoid an even bigger thorny mess |
43 // to untangle much later down the line. Disabling the test also means that the | 43 // to untangle much later down the line. Disabling the test also means that the |
44 // people who get blamed are not the ones that introduced the crash (in other | 44 // people who get blamed are not the ones that introduced the crash (in other |
45 // words, don't shoot the messenger). So, please help us avoid additional | 45 // words, don't shoot the messenger). So, please help us avoid additional |
46 // shutdown crashes from creeping in, by doing the following: | 46 // shutdown crashes from creeping in, by doing the following: |
47 // Run chrome.exe --try-chrome-again=10001. This is all that the test does and | 47 // Run chrome.exe --try-chrome-again=10001. This is all that the test does and |
48 // should be enough to trigger the failure. If it is a crash (most likely) then | 48 // should be enough to trigger the failure. If it is a crash (most likely) then |
49 // look at the callstack and see if any of the components have been touched | 49 // look at the callstack and see if any of the components have been touched |
50 // recently. Look at recent changes to startup, such as any change to | 50 // recently. Look at recent changes to startup, such as any change to |
51 // ChromeBrowserMainParts, specifically PreCreateThreadsImpl and see if someone | 51 // ChromeBrowserMainParts, specifically PreCreateThreadsImpl and see if someone |
52 // has been reordering code blocks for startup. Try reverting any suspicious | 52 // has been reordering code blocks for startup. Try reverting any suspicious |
53 // changes to see if it affects the test. History shows that waiting until later | 53 // changes to see if it affects the test. History shows that waiting until later |
54 // only makes the problem worse. | 54 // only makes the problem worse. |
55 IN_PROC_BROWSER_TEST_F(TryChromeDialogBrowserTest, ToastCrasher) {} | 55 IN_PROC_BROWSER_TEST_F(TryChromeDialogBrowserTest, ToastCrasher) {} |
56 | 56 |
57 #endif // defined(OS_WIN) | 57 #endif // defined(OS_WIN) |
OLD | NEW |