OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/message_loop/message_loop.h" |
5 #include "base/win/wrapped_window_proc.h" | 6 #include "base/win/wrapped_window_proc.h" |
6 #include "base/message_loop.h" | |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
11 DWORD kExceptionCode = 12345; | 11 DWORD kExceptionCode = 12345; |
12 WPARAM kCrashMsg = 98765; | 12 WPARAM kCrashMsg = 98765; |
13 | 13 |
14 // A trivial WindowProc that generates an exception. | 14 // A trivial WindowProc that generates an exception. |
15 LRESULT CALLBACK TestWindowProc(HWND hwnd, UINT message, | 15 LRESULT CALLBACK TestWindowProc(HWND hwnd, UINT message, |
16 WPARAM wparam, LPARAM lparam) { | 16 WPARAM wparam, LPARAM lparam) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // Before generating the exception we make sure that the filter will see it. | 70 // Before generating the exception we make sure that the filter will see it. |
71 TestWrappedExceptionFiter wrapper; | 71 TestWrappedExceptionFiter wrapper; |
72 base::win::WinProcExceptionFilter old_filter = | 72 base::win::WinProcExceptionFilter old_filter = |
73 base::win::SetWinProcExceptionFilter(TestWrappedExceptionFiter::Filter); | 73 base::win::SetWinProcExceptionFilter(TestWrappedExceptionFiter::Filter); |
74 | 74 |
75 SendMessage(window, kCrashMsg, 0, 0); | 75 SendMessage(window, kCrashMsg, 0, 0); |
76 EXPECT_TRUE(wrapper.called()); | 76 EXPECT_TRUE(wrapper.called()); |
77 | 77 |
78 base::win::SetWinProcExceptionFilter(old_filter); | 78 base::win::SetWinProcExceptionFilter(old_filter); |
79 } | 79 } |
OLD | NEW |