OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome_frame/crash_reporting/nt_loader.h" | 5 #include "chrome_frame/crash_reporting/nt_loader.h" |
5 | 6 |
6 #include <tlhelp32.h> | 7 #include <tlhelp32.h> |
7 #include <winnt.h> | 8 #include <winnt.h> |
8 #include <base/at_exit.h> | 9 |
9 #include <base/environment.h> | 10 #include "base/at_exit.h" |
10 #include <base/message_loop.h> | 11 #include "base/environment.h" |
11 #include <base/scoped_handle.h> | 12 #include "base/message_loop.h" |
12 #include <base/scoped_ptr.h> | 13 #include "base/scoped_handle.h" |
13 #include <base/string_util.h> | 14 #include "base/scoped_ptr.h" |
14 #include <base/sys_info.h> | 15 #include "base/string_util.h" |
15 #include <base/thread.h> | 16 #include "base/sys_info.h" |
16 #include <base/utf_string_conversions.h> | 17 #include "base/threading/thread.h" |
| 18 #include "base/utf_string_conversions.h" |
17 #include "chrome_frame/crash_reporting/crash_dll.h" | 19 #include "chrome_frame/crash_reporting/crash_dll.h" |
18 #include "gtest/gtest.h" | 20 #include "gtest/gtest.h" |
19 | 21 |
20 namespace { | 22 namespace { |
21 void AssertIsCriticalSection(CRITICAL_SECTION* critsec) { | 23 void AssertIsCriticalSection(CRITICAL_SECTION* critsec) { |
22 // Assert on some of the internals of the debug info if it has one. | 24 // Assert on some of the internals of the debug info if it has one. |
23 RTL_CRITICAL_SECTION_DEBUG* debug = critsec->DebugInfo; | 25 RTL_CRITICAL_SECTION_DEBUG* debug = critsec->DebugInfo; |
24 if (debug) { | 26 if (debug) { |
25 ASSERT_EQ(RTL_CRITSECT_TYPE, debug->Type); | 27 ASSERT_EQ(RTL_CRITSECT_TYPE, debug->Type); |
26 ASSERT_EQ(critsec, debug->CriticalSection); | 28 ASSERT_EQ(critsec, debug->CriticalSection); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 311 |
310 exceptions_handled = 0; | 312 exceptions_handled = 0; |
311 set_exception_function(OnCrashDuringUnloadLibrary); | 313 set_exception_function(OnCrashDuringUnloadLibrary); |
312 | 314 |
313 // We should crash during unload. | 315 // We should crash during unload. |
314 if (module != NULL) | 316 if (module != NULL) |
315 ::FreeLibrary(module); | 317 ::FreeLibrary(module); |
316 | 318 |
317 EXPECT_EQ(1, exceptions_handled); | 319 EXPECT_EQ(1, exceptions_handled); |
318 } | 320 } |
OLD | NEW |