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

Side by Side Diff: minidump/minidump_exception_writer_test.cc

Issue 703223003: Add MinidumpFileWriter::InitializeFromSnapshot() and its tests (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_crashpad_info_init_from_snapshot
Patch Set: Address review feedback Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « minidump/minidump_exception_writer.cc ('k') | minidump/minidump_file_writer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 exception_snapshot.SetExceptionAddress( 225 exception_snapshot.SetExceptionAddress(
226 expect_exception.ExceptionRecord.ExceptionAddress); 226 expect_exception.ExceptionRecord.ExceptionAddress);
227 exception_snapshot.SetCodes(exception_codes); 227 exception_snapshot.SetCodes(exception_codes);
228 228
229 InitializeCPUContextX86(exception_snapshot.MutableContext(), kSeed); 229 InitializeCPUContextX86(exception_snapshot.MutableContext(), kSeed);
230 230
231 MinidumpThreadIDMap thread_id_map; 231 MinidumpThreadIDMap thread_id_map;
232 thread_id_map[kThreadID] = expect_exception.ThreadId; 232 thread_id_map[kThreadID] = expect_exception.ThreadId;
233 233
234 auto exception_writer = make_scoped_ptr(new MinidumpExceptionWriter()); 234 auto exception_writer = make_scoped_ptr(new MinidumpExceptionWriter());
235 exception_writer->InitializeFromSnapshot(&exception_snapshot, &thread_id_map); 235 exception_writer->InitializeFromSnapshot(&exception_snapshot, thread_id_map);
236 236
237 MinidumpFileWriter minidump_file_writer; 237 MinidumpFileWriter minidump_file_writer;
238 minidump_file_writer.AddStream(exception_writer.Pass()); 238 minidump_file_writer.AddStream(exception_writer.Pass());
239 239
240 StringFileWriter file_writer; 240 StringFileWriter file_writer;
241 ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer)); 241 ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
242 242
243 const MINIDUMP_EXCEPTION_STREAM* exception; 243 const MINIDUMP_EXCEPTION_STREAM* exception;
244 ASSERT_NO_FATAL_FAILURE(GetExceptionStream(file_writer.string(), &exception)); 244 ASSERT_NO_FATAL_FAILURE(GetExceptionStream(file_writer.string(), &exception));
245 245
(...skipping 21 matching lines...) Expand all
267 MinidumpExceptionWriter exception_writer; 267 MinidumpExceptionWriter exception_writer;
268 std::vector<uint64_t> exception_information(EXCEPTION_MAXIMUM_PARAMETERS + 1, 268 std::vector<uint64_t> exception_information(EXCEPTION_MAXIMUM_PARAMETERS + 1,
269 0x5a5a5a5a5a5a5a5a); 269 0x5a5a5a5a5a5a5a5a);
270 ASSERT_DEATH(exception_writer.SetExceptionInformation(exception_information), 270 ASSERT_DEATH(exception_writer.SetExceptionInformation(exception_information),
271 "kMaxParameters"); 271 "kMaxParameters");
272 } 272 }
273 273
274 } // namespace 274 } // namespace
275 } // namespace test 275 } // namespace test
276 } // namespace crashpad 276 } // namespace crashpad
OLDNEW
« no previous file with comments | « minidump/minidump_exception_writer.cc ('k') | minidump/minidump_file_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698