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

Unified Diff: chrome_frame/crash_reporting/veh_test.cc

Issue 126143005: Remove Chrome Frame code and resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to r244038 Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/crash_reporting/veh_test.h ('k') | chrome_frame/crash_server_init.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/crash_reporting/veh_test.cc
diff --git a/chrome_frame/crash_reporting/veh_test.cc b/chrome_frame/crash_reporting/veh_test.cc
deleted file mode 100644
index ec868efa0d8f0cc9f499bb25bad5318e323f423b..0000000000000000000000000000000000000000
--- a/chrome_frame/crash_reporting/veh_test.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <atlbase.h>
-#include "chrome_frame/crash_reporting/veh_test.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "chrome_frame/crash_reporting/vectored_handler-impl.h"
-
-#pragma code_seg(push, ".m$_0")
-static void ModuleStart() {}
-#pragma code_seg(pop)
-
-#pragma code_seg(push, ".m$_2")
-DECLSPEC_NOINLINE static void Undetectable(DWORD code) {
- __try {
- ::RaiseException(code, 0, 0, NULL);
- } __except(EXCEPTION_EXECUTE_HANDLER) {
-
- }
-};
-#pragma code_seg(pop)
-
-#pragma code_seg(push, ".m$_3")
-static void UndetectableEnd() {}
-#pragma code_seg(pop)
-
-#pragma code_seg(push, ".m$_4")
-DECLSPEC_NOINLINE static void CatchThis() {
- __try {
- ::RaiseException(STATUS_ACCESS_VIOLATION, 0, 0, NULL);
- } __except(EXCEPTION_EXECUTE_HANDLER) {
-
- }
-
- // this will be detected since we are on the stack!
- Undetectable(STATUS_ILLEGAL_INSTRUCTION);
-}
-#pragma code_seg(pop)
-
-#pragma code_seg(push, ".m$_9")
-static void ModuleEnd() {}
-#pragma code_seg(pop)
-
-using testing::_;
-namespace {
-MATCHER_P(ExceptionCodeIs, code, "") {
- return (arg->ExceptionRecord->ExceptionCode == code);
-}
-
-class MockApi : public Win32VEHTraits,
- public ModuleOfInterestWithExcludedRegion {
- public:
- MockApi() {
- ModuleOfInterestWithExcludedRegion::SetModule(&ModuleStart, &ModuleEnd);
- ModuleOfInterestWithExcludedRegion::SetExcludedRegion(&Undetectable,
- &UndetectableEnd);
- }
-
- MOCK_METHOD1(WriteDump, void(const EXCEPTION_POINTERS*));
- MOCK_METHOD0(RtlpGetExceptionList, const EXCEPTION_REGISTRATION_RECORD*());
-};
-}; // namespace
-
-typedef VectoredHandlerT<MockApi> VectoredHandlerMock;
-
-#pragma optimize("y", off)
-static VectoredHandlerMock* g_mock_veh = NULL;
-static LONG WINAPI VEH(EXCEPTION_POINTERS* exptrs) {
- return g_mock_veh->Handler(exptrs);
-}
-#pragma optimize("y", on)
-
-TEST(ChromeFrame, ExceptionExcludedCode) {
- MockApi api;
- VectoredHandlerMock veh(&api);
-
- g_mock_veh = &veh;
- void* id = ::AddVectoredExceptionHandler(FALSE, VEH);
-
- EXPECT_CALL(api, RtlpGetExceptionList())
- .WillRepeatedly(testing::Return(EXCEPTION_CHAIN_END));
-
- testing::Sequence s;
-
- EXPECT_CALL(api, WriteDump(ExceptionCodeIs(STATUS_ACCESS_VIOLATION)))
- .Times(1);
-
- EXPECT_CALL(api, WriteDump(ExceptionCodeIs(STATUS_ILLEGAL_INSTRUCTION)))
- .Times(1);
-
- CatchThis();
- EXPECT_EQ(2, veh.get_exceptions_seen());
-
- // Not detected since we are not on the stack.
- Undetectable(STATUS_INTEGER_DIVIDE_BY_ZERO);
- EXPECT_EQ(3, veh.get_exceptions_seen());
-
- ::RemoveVectoredExceptionHandler(id);
- g_mock_veh = NULL;
-}
« no previous file with comments | « chrome_frame/crash_reporting/veh_test.h ('k') | chrome_frame/crash_server_init.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698