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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 #elif defined(OS_MACOSX) | 103 #elif defined(OS_MACOSX) |
104 // Crash service doesn't exist for the Mac yet: http://crbug.com/45243 | 104 // Crash service doesn't exist for the Mac yet: http://crbug.com/45243 |
105 #define Assertion DISABLED_Assertion | 105 #define Assertion DISABLED_Assertion |
106 #endif | 106 #endif |
107 TEST_F(AssertionTest, Assertion) { | 107 TEST_F(AssertionTest, Assertion) { |
108 expected_errors_ = EXPECTED_ASSERT_ERRORS; | 108 expected_errors_ = EXPECTED_ASSERT_ERRORS; |
109 expected_crashes_ = EXPECTED_ASSERT_CRASHES; | 109 expected_crashes_ = EXPECTED_ASSERT_CRASHES; |
110 } | 110 } |
111 #endif // !defined(NDEBUG) | 111 #endif // !defined(NDEBUG) |
112 | 112 |
113 #if !defined(OFFICIAL_BUILD) | 113 #if !defined(GOOGLE_CHROME_BUILD) |
114 // Only works on Linux in Release mode with CHROME_HEADLESS=1 | 114 // Only works on Linux in Release mode with CHROME_HEADLESS=1 |
115 class CheckFalseTest : public UITest { | 115 class CheckFalseTest : public UITest { |
116 protected: | 116 protected: |
117 CheckFalseTest() { | 117 CheckFalseTest() { |
118 #if defined(OS_WIN) | 118 #if defined(OS_WIN) |
119 // TODO(phajdan.jr): Make crash notifications on launch work on Win. | 119 // TODO(phajdan.jr): Make crash notifications on launch work on Win. |
120 wait_for_initial_loads_ = false; | 120 wait_for_initial_loads_ = false; |
121 #endif | 121 #endif |
122 launch_arguments_.AppendSwitch(switches::kRendererCheckFalseTest); | 122 launch_arguments_.AppendSwitch(switches::kRendererCheckFalseTest); |
123 } | 123 } |
124 }; | 124 }; |
125 | 125 |
126 #if defined(OS_WIN) | 126 #if defined(OS_WIN) |
127 // http://crbug.com/38497 | 127 // http://crbug.com/38497 |
128 #define CheckFails DISABLED_CheckFails | 128 #define CheckFails DISABLED_CheckFails |
129 #elif defined(OS_MACOSX) | 129 #elif defined(OS_MACOSX) |
130 // Crash service doesn't exist for the Mac yet: http://crbug.com/45243 | 130 // Crash service doesn't exist for the Mac yet: http://crbug.com/45243 |
131 #define CheckFails DISABLED_CheckFails | 131 #define CheckFails DISABLED_CheckFails |
132 #endif | 132 #endif |
133 // Launch the app in assertion test mode, then close the app. | 133 // Launch the app in assertion test mode, then close the app. |
134 TEST_F(CheckFalseTest, CheckFails) { | 134 TEST_F(CheckFalseTest, CheckFails) { |
135 expected_errors_ = EXPECTED_ASSERT_ERRORS; | 135 expected_errors_ = EXPECTED_ASSERT_ERRORS; |
136 expected_crashes_ = EXPECTED_ASSERT_CRASHES; | 136 expected_crashes_ = EXPECTED_ASSERT_CRASHES; |
137 } | 137 } |
138 #endif // !defined(OFFICIAL_BUILD) | 138 #endif // !defined(GOOGLE_CHROME_BUILD) |
139 | 139 |
140 // Tests whether we correctly fail on browser crashes during UI Tests. | 140 // Tests whether we correctly fail on browser crashes during UI Tests. |
141 class RendererCrashTest : public UITest { | 141 class RendererCrashTest : public UITest { |
142 protected: | 142 protected: |
143 RendererCrashTest() { | 143 RendererCrashTest() { |
144 #if defined(OS_WIN) | 144 #if defined(OS_WIN) |
145 // TODO(phajdan.jr): Make crash notifications on launch work on Win. | 145 // TODO(phajdan.jr): Make crash notifications on launch work on Win. |
146 wait_for_initial_loads_ = false; | 146 wait_for_initial_loads_ = false; |
147 #endif | 147 #endif |
148 launch_arguments_.AppendSwitch(switches::kRendererCrashTest); | 148 launch_arguments_.AppendSwitch(switches::kRendererCrashTest); |
(...skipping 15 matching lines...) Expand all Loading... |
164 #else | 164 #else |
165 #define MAYBE_Crash Crash | 165 #define MAYBE_Crash Crash |
166 #endif | 166 #endif |
167 // 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. |
168 TEST_F(RendererCrashTest, MAYBE_Crash) { | 168 TEST_F(RendererCrashTest, MAYBE_Crash) { |
169 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 169 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
170 ASSERT_TRUE(browser.get()); | 170 ASSERT_TRUE(browser.get()); |
171 ASSERT_TRUE(browser->WaitForTabCountToBecome(1)); | 171 ASSERT_TRUE(browser->WaitForTabCountToBecome(1)); |
172 expected_crashes_ = EXPECTED_CRASH_CRASHES; | 172 expected_crashes_ = EXPECTED_CRASH_CRASHES; |
173 } | 173 } |
OLD | NEW |