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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 TEST_F(ChromeLoggingTest, EnvironmentLogFileName) { | 59 TEST_F(ChromeLoggingTest, EnvironmentLogFileName) { |
60 SaveEnvironmentVariable("test value"); | 60 SaveEnvironmentVariable("test value"); |
61 | 61 |
62 FilePath filename = logging::GetLogFileName(); | 62 FilePath filename = logging::GetLogFileName(); |
63 ASSERT_EQ(FilePath(FILE_PATH_LITERAL("test value")).value(), | 63 ASSERT_EQ(FilePath(FILE_PATH_LITERAL("test value")).value(), |
64 filename.value()); | 64 filename.value()); |
65 | 65 |
66 RestoreEnvironmentVariable(); | 66 RestoreEnvironmentVariable(); |
67 } | 67 } |
68 | 68 |
69 #if defined(OS_LINUX) && (!defined(NDEBUG) || !defined(USE_LINUX_BREAKPAD)) | 69 #if (defined(OS_LINUX) || defined(OS_ANDROID)) \ |
| 70 && (!defined(NDEBUG) || !defined(USE_POSIX_BREAKPAD)) |
70 // On Linux in Debug mode, Chrome generates a SIGTRAP. | 71 // On Linux in Debug mode, Chrome generates a SIGTRAP. |
71 // we do not catch SIGTRAPs, thus no crash dump. | 72 // we do not catch SIGTRAPs, thus no crash dump. |
72 // This also does not work if Breakpad is disabled. | 73 // This also does not work if Breakpad is disabled. |
73 #define EXPECTED_ASSERT_CRASHES 0 | 74 #define EXPECTED_ASSERT_CRASHES 0 |
74 #else | 75 #else |
75 #define EXPECTED_ASSERT_CRASHES 1 | 76 #define EXPECTED_ASSERT_CRASHES 1 |
76 #endif | 77 #endif |
77 | 78 |
78 // Virtual keyboard build will start an extra renderer process (the extension | 79 // Virtual keyboard build will start an extra renderer process (the extension |
79 // process) for the virtual keyboard. | 80 // process) for the virtual keyboard. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 protected: | 143 protected: |
143 RendererCrashTest() { | 144 RendererCrashTest() { |
144 #if defined(OS_WIN) | 145 #if defined(OS_WIN) |
145 // TODO(phajdan.jr): Make crash notifications on launch work on Win. | 146 // TODO(phajdan.jr): Make crash notifications on launch work on Win. |
146 wait_for_initial_loads_ = false; | 147 wait_for_initial_loads_ = false; |
147 #endif | 148 #endif |
148 launch_arguments_.AppendSwitch(switches::kRendererCrashTest); | 149 launch_arguments_.AppendSwitch(switches::kRendererCrashTest); |
149 } | 150 } |
150 }; | 151 }; |
151 | 152 |
152 #if defined(OS_LINUX) && !defined(USE_LINUX_BREAKPAD) | 153 #if (defined(OS_LINUX) || defined(OS_ANDROID)) && !defined(USE_POSIX_BREAKPAD) |
153 // On Linux, do not expect a crash dump if Breakpad is disabled. | 154 // On Linux, do not expect a crash dump if Breakpad is disabled. |
154 #define EXPECTED_CRASH_CRASHES 0 | 155 #define EXPECTED_CRASH_CRASHES 0 |
155 #else | 156 #else |
156 #define EXPECTED_CRASH_CRASHES 1 | 157 #define EXPECTED_CRASH_CRASHES 1 |
157 #endif | 158 #endif |
158 | 159 |
159 #if defined(OS_MACOSX) | 160 #if defined(OS_MACOSX) |
160 // Crash service doesn't exist for the Mac yet: http://crbug.com/45243 | 161 // Crash service doesn't exist for the Mac yet: http://crbug.com/45243 |
161 #define MAYBE_Crash DISABLED_Crash | 162 #define MAYBE_Crash DISABLED_Crash |
162 #elif defined(OS_CHROMEOS) | 163 #elif defined(OS_CHROMEOS) |
163 #define MAYBE_Crash DISABLED_Crash | 164 #define MAYBE_Crash DISABLED_Crash |
164 #else | 165 #else |
165 #define MAYBE_Crash Crash | 166 #define MAYBE_Crash Crash |
166 #endif | 167 #endif |
167 // Launch the app in renderer crash test mode, then close the app. | 168 // Launch the app in renderer crash test mode, then close the app. |
168 TEST_F(RendererCrashTest, MAYBE_Crash) { | 169 TEST_F(RendererCrashTest, MAYBE_Crash) { |
169 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 170 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
170 ASSERT_TRUE(browser.get()); | 171 ASSERT_TRUE(browser.get()); |
171 ASSERT_TRUE(browser->WaitForTabCountToBecome(1)); | 172 ASSERT_TRUE(browser->WaitForTabCountToBecome(1)); |
172 expected_crashes_ = EXPECTED_CRASH_CRASHES; | 173 expected_crashes_ = EXPECTED_CRASH_CRASHES; |
173 } | 174 } |
OLD | NEW |