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 <stdio.h> | 5 #include <stdio.h> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 ASSERT_TRUE(crash_server_->Start()); | 137 ASSERT_TRUE(crash_server_->Start()); |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 TEST_F(BreakpadWinDeathTest, TestAccessViolation) { | 141 TEST_F(BreakpadWinDeathTest, TestAccessViolation) { |
142 if (callbacks_.get()) { | 142 if (callbacks_.get()) { |
143 EXPECT_CALL(*callbacks_, OnClientDumpRequested()); | 143 EXPECT_CALL(*callbacks_, OnClientDumpRequested()); |
144 } | 144 } |
145 | 145 |
146 // Generate access violation exception. | 146 // Generate access violation exception. |
147 ASSERT_DEATH(*reinterpret_cast<int*>(NULL) = 1, ""); | 147 ASSERT_DEATH(*reinterpret_cast<volatile int*>(NULL) = 1, ""); |
148 } | 148 } |
149 | 149 |
150 TEST_F(BreakpadWinDeathTest, TestInvalidParameter) { | 150 TEST_F(BreakpadWinDeathTest, TestInvalidParameter) { |
151 if (callbacks_.get()) { | 151 if (callbacks_.get()) { |
152 EXPECT_CALL(*callbacks_, OnClientDumpRequested()); | 152 EXPECT_CALL(*callbacks_, OnClientDumpRequested()); |
153 } | 153 } |
154 | 154 |
155 // Cause the invalid parameter callback to be called. | 155 // Cause the invalid parameter callback to be called. |
156 ASSERT_EXIT(printf(NULL), testing::ExitedWithCode(0), ""); | 156 ASSERT_EXIT(printf(NULL), testing::ExitedWithCode(0), ""); |
157 } | 157 } |
158 | 158 |
159 TEST_F(BreakpadWinDeathTest, TestDebugbreak) { | 159 TEST_F(BreakpadWinDeathTest, TestDebugbreak) { |
160 if (callbacks_.get()) { | 160 if (callbacks_.get()) { |
161 EXPECT_CALL(*callbacks_, OnClientDumpRequested()); | 161 EXPECT_CALL(*callbacks_, OnClientDumpRequested()); |
162 } | 162 } |
163 | 163 |
164 // See if __debugbreak() is intercepted. | 164 // See if __debugbreak() is intercepted. |
165 ASSERT_DEATH(__debugbreak(), ""); | 165 ASSERT_DEATH(__debugbreak(), ""); |
166 } | 166 } |
167 | 167 |
168 } // namespace remoting | 168 } // namespace remoting |
OLD | NEW |