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