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

Unified Diff: chrome_frame/crash_reporting/vectored_handler_unittest.cc

Issue 5622006: Improve filtering for false positive crashes... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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/vectored_handler-impl.h ('k') | chrome_frame/crash_reporting/veh_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/crash_reporting/vectored_handler_unittest.cc
===================================================================
--- chrome_frame/crash_reporting/vectored_handler_unittest.cc (revision 68282)
+++ chrome_frame/crash_reporting/vectored_handler_unittest.cc (working copy)
@@ -23,9 +23,7 @@
namespace {
class MockApi : public Win32VEHTraits, public ModuleOfInterest {
public:
- MockApi() {
- Win32VEHTraits::InitializeIgnoredBlocks();
- }
+ MockApi() {}
MOCK_METHOD1(WriteDump, void(const EXCEPTION_POINTERS*));
MOCK_METHOD0(RtlpGetExceptionList, const EXCEPTION_REGISTRATION_RECORD*());
@@ -60,7 +58,7 @@
VectoredHandlerMock veh(&api);
// Start address of our module.
- char* s = reinterpret_cast<char*>(0x30000000);
+ char* s = reinterpret_cast<char*>(&__ImageBase);
char *e = s + 0x10000;
api.SetModule(s, e);
@@ -84,6 +82,7 @@
// RPC_E_DISCONNECTED (0x80010108) is "The object invoked has disconnected
// from its clients", shall not be caught since it's a warning only.
EXPECT_CALL(api, WriteDump(_)).Times(0);
+ EXPECT_CALL(api, RtlpGetExceptionList()).Times(0);
EXPECT_EQ(ExceptionContinueSearch,
veh.Handler(&ExceptionInfo(RPC_E_DISCONNECTED, our_code)));
testing::Mock::VerifyAndClearExpectations(&api);
@@ -114,21 +113,22 @@
testing::Mock::VerifyAndClearExpectations(&api);
// Exception, in IsBadStringPtrA, we are on the stack.
- api.SetSEH(no_seh);
+ char* is_bad_ptr = reinterpret_cast<char*>(GetProcAddress(
+ GetModuleHandleA("kernel32.dll"), "IsBadStringPtrA"));
+ SEHChain kernel32_seh(is_bad_ptr, is_bad_ptr + 0x100, NULL);
+ api.SetSEH(kernel32_seh);
api.SetStack(on_stack);
EXPECT_CALL(api, WriteDump(_)).Times(0);
- char* ignore_address = reinterpret_cast<char*>(GetProcAddress(
- GetModuleHandleA("kernel32.dll"), "IsBadStringPtrA")) + 10;
EXPECT_EQ(ExceptionContinueSearch,
- veh.Handler(&ExceptionInfo(STATUS_ACCESS_VIOLATION, ignore_address)));
+ veh.Handler(&ExceptionInfo(STATUS_ACCESS_VIOLATION, is_bad_ptr)));
testing::Mock::VerifyAndClearExpectations(&api);
// Exception, in IsBadStringPtrA, we are not on the stack.
- api.SetSEH(no_seh);
+ api.SetSEH(kernel32_seh);
api.SetStack(not_on_stack);
EXPECT_CALL(api, WriteDump(_)).Times(0);
EXPECT_EQ(ExceptionContinueSearch,
- veh.Handler(&ExceptionInfo(STATUS_ACCESS_VIOLATION, ignore_address)));
+ veh.Handler(&ExceptionInfo(STATUS_ACCESS_VIOLATION, is_bad_ptr)));
testing::Mock::VerifyAndClearExpectations(&api);
// Exception in a loading module, we are on the stack.
« no previous file with comments | « chrome_frame/crash_reporting/vectored_handler-impl.h ('k') | chrome_frame/crash_reporting/veh_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698