OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 <string> | 5 #include <string> |
6 #include <windows.h> | 6 #include <windows.h> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 launch_arguments_.AppendSwitch(switches::kRendererCrashTest); | 101 launch_arguments_.AppendSwitch(switches::kRendererCrashTest); |
102 } | 102 } |
103 }; | 103 }; |
104 | 104 |
105 // Launch the app in renderer crash test mode, then close the app. | 105 // Launch the app in renderer crash test mode, then close the app. |
106 TEST_F(RendererCrashTest, Crash) { | 106 TEST_F(RendererCrashTest, Crash) { |
107 if (UITest::in_process_renderer()) { | 107 if (UITest::in_process_renderer()) { |
108 // in process mode doesn't do the crashing. | 108 // in process mode doesn't do the crashing. |
109 expected_crashes_ = 0; | 109 expected_crashes_ = 0; |
110 } else { | 110 } else { |
111 scoped_ptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 111 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
112 ASSERT_TRUE(browser->WaitForTabCountToBecome(1, action_max_timeout_ms())); | 112 ASSERT_TRUE(browser->WaitForTabCountToBecome(1, action_max_timeout_ms())); |
113 expected_crashes_ = 1; | 113 expected_crashes_ = 1; |
114 } | 114 } |
115 } | 115 } |
116 | 116 |
117 // Tests whether we correctly fail on browser crashes during UI Tests. | 117 // Tests whether we correctly fail on browser crashes during UI Tests. |
118 class BrowserCrashTest : public UITest { | 118 class BrowserCrashTest : public UITest { |
119 protected: | 119 protected: |
120 BrowserCrashTest() : UITest() | 120 BrowserCrashTest() : UITest() |
121 { | 121 { |
122 // Initial loads will never complete due to crash. | 122 // Initial loads will never complete due to crash. |
123 wait_for_initial_loads_ = false; | 123 wait_for_initial_loads_ = false; |
124 | 124 |
125 launch_arguments_.AppendSwitch(switches::kBrowserCrashTest); | 125 launch_arguments_.AppendSwitch(switches::kBrowserCrashTest); |
126 } | 126 } |
127 }; | 127 }; |
128 | 128 |
129 // Launch the app in browser crash test mode. | 129 // Launch the app in browser crash test mode. |
130 // This test is disabled. See bug 6910. | 130 // This test is disabled. See bug 6910. |
131 TEST_F(BrowserCrashTest, DISABLED_Crash) { | 131 TEST_F(BrowserCrashTest, DISABLED_Crash) { |
132 // Wait while the process is writing the crash dump. | 132 // Wait while the process is writing the crash dump. |
133 PlatformThread::Sleep(5000); | 133 PlatformThread::Sleep(5000); |
134 expected_crashes_ = 1; | 134 expected_crashes_ = 1; |
135 } | 135 } |
OLD | NEW |