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 |
5 #include <atlbase.h> | 5 #include <atlbase.h> |
6 #include "chrome_frame/crash_reporting/veh_test.h" | 6 #include "chrome_frame/crash_reporting/veh_test.h" |
7 #include "testing/gmock/include/gmock/gmock.h" | 7 #include "testing/gmock/include/gmock/gmock.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "chrome_frame/crash_reporting/vectored_handler-impl.h" | 9 #include "chrome_frame/crash_reporting/vectored_handler-impl.h" |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 using testing::_; | 46 using testing::_; |
47 namespace { | 47 namespace { |
48 MATCHER_P(ExceptionCodeIs, code, "") { | 48 MATCHER_P(ExceptionCodeIs, code, "") { |
49 return (arg->ExceptionRecord->ExceptionCode == code); | 49 return (arg->ExceptionRecord->ExceptionCode == code); |
50 } | 50 } |
51 | 51 |
52 class MockApi : public Win32VEHTraits, | 52 class MockApi : public Win32VEHTraits, |
53 public ModuleOfInterestWithExcludedRegion { | 53 public ModuleOfInterestWithExcludedRegion { |
54 public: | 54 public: |
55 MockApi() { | 55 MockApi() { |
56 Win32VEHTraits::InitializeIgnoredBlocks(); | |
57 ModuleOfInterestWithExcludedRegion::SetModule(&ModuleStart, &ModuleEnd); | 56 ModuleOfInterestWithExcludedRegion::SetModule(&ModuleStart, &ModuleEnd); |
58 ModuleOfInterestWithExcludedRegion::SetExcludedRegion(&Undetectable, | 57 ModuleOfInterestWithExcludedRegion::SetExcludedRegion(&Undetectable, |
59 &UndetectableEnd); | 58 &UndetectableEnd); |
60 } | 59 } |
61 | 60 |
62 MOCK_METHOD1(WriteDump, void(const EXCEPTION_POINTERS*)); | 61 MOCK_METHOD1(WriteDump, void(const EXCEPTION_POINTERS*)); |
63 MOCK_METHOD0(RtlpGetExceptionList, const EXCEPTION_REGISTRATION_RECORD*()); | 62 MOCK_METHOD0(RtlpGetExceptionList, const EXCEPTION_REGISTRATION_RECORD*()); |
64 }; | 63 }; |
65 }; // namespace | 64 }; // namespace |
66 | 65 |
(...skipping 27 matching lines...) Expand all Loading... |
94 CatchThis(); | 93 CatchThis(); |
95 EXPECT_EQ(2, veh.get_exceptions_seen()); | 94 EXPECT_EQ(2, veh.get_exceptions_seen()); |
96 | 95 |
97 // Not detected since we are not on the stack. | 96 // Not detected since we are not on the stack. |
98 Undetectable(STATUS_INTEGER_DIVIDE_BY_ZERO); | 97 Undetectable(STATUS_INTEGER_DIVIDE_BY_ZERO); |
99 EXPECT_EQ(3, veh.get_exceptions_seen()); | 98 EXPECT_EQ(3, veh.get_exceptions_seen()); |
100 | 99 |
101 ::RemoveVectoredExceptionHandler(id); | 100 ::RemoveVectoredExceptionHandler(id); |
102 g_mock_veh = NULL; | 101 g_mock_veh = NULL; |
103 } | 102 } |
OLD | NEW |