Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: remoting/base/breakpad_win_unittest.cc

Issue 2745373002: Fix remoting_unittests!BreakpadWinDeathTest.TestAccessViolation under WinASan (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 NULL, 133 NULL,
134 NULL, 134 NULL,
135 NULL, 135 NULL,
136 false, 136 false,
137 NULL)); 137 NULL));
138 ASSERT_TRUE(crash_server_->Start()); 138 ASSERT_TRUE(crash_server_->Start());
139 } 139 }
140 } 140 }
141 141
142 TEST_F(BreakpadWinDeathTest, TestAccessViolation) { 142 TEST_F(BreakpadWinDeathTest, TestAccessViolation) {
143 #if !defined(ADDRESS_SANITIZER)
144 // ASan overrides the user unhandled exception filter so we won't receive this
145 // callback.
143 if (callbacks_.get()) { 146 if (callbacks_.get()) {
144 EXPECT_CALL(*callbacks_, OnClientDumpRequested()); 147 EXPECT_CALL(*callbacks_, OnClientDumpRequested());
145 } 148 }
149 #endif
Sergey Ulanov 2017/03/14 19:44:35 // !defined(ADDRESS_SANITIZER)
146 150
147 // Generate access violation exception. 151 // Generate access violation exception.
148 ASSERT_DEATH(*reinterpret_cast<volatile int*>(NULL) = 1, ""); 152 ASSERT_DEATH(*reinterpret_cast<volatile int*>(NULL) = 1, "");
149 } 153 }
150 154
151 TEST_F(BreakpadWinDeathTest, TestInvalidParameter) { 155 TEST_F(BreakpadWinDeathTest, TestInvalidParameter) {
152 if (callbacks_.get()) { 156 if (callbacks_.get()) {
153 EXPECT_CALL(*callbacks_, OnClientDumpRequested()); 157 EXPECT_CALL(*callbacks_, OnClientDumpRequested());
154 } 158 }
155 159
156 // Cause the invalid parameter callback to be called. 160 // Cause the invalid parameter callback to be called.
157 ASSERT_EXIT(printf(NULL), testing::ExitedWithCode(0), ""); 161 ASSERT_EXIT(printf(NULL), testing::ExitedWithCode(0), "");
158 } 162 }
159 163
160 TEST_F(BreakpadWinDeathTest, TestDebugbreak) { 164 TEST_F(BreakpadWinDeathTest, TestDebugbreak) {
161 if (callbacks_.get()) { 165 if (callbacks_.get()) {
162 EXPECT_CALL(*callbacks_, OnClientDumpRequested()); 166 EXPECT_CALL(*callbacks_, OnClientDumpRequested());
163 } 167 }
164 168
165 // See if __debugbreak() is intercepted. 169 // See if __debugbreak() is intercepted.
166 ASSERT_DEATH(__debugbreak(), ""); 170 ASSERT_DEATH(__debugbreak(), "");
167 } 171 }
168 172
169 } // namespace remoting 173 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698