OLD | NEW |
1 // Copyright (c) 2010 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 #include <windows.h> | 5 #include <windows.h> |
5 #include <objbase.h> | 6 #include <objbase.h> |
6 #include <dbghelp.h> | 7 #include <dbghelp.h> |
7 | 8 |
8 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
10 #include "base/file_path.h" | 11 #include "base/file_path.h" |
11 #include "base/file_util.h" | 12 #include "base/file_util.h" |
12 #include "base/file_version_info.h" | 13 #include "base/file_version_info.h" |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #include "base/scoped_handle_win.h" | 15 #include "base/win/scoped_handle.h" |
15 #include "gtest/gtest.h" | 16 #include "gtest/gtest.h" |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 // Convenience to get to the PEB pointer in a TEB. | 20 // Convenience to get to the PEB pointer in a TEB. |
20 struct FakeTEB { | 21 struct FakeTEB { |
21 char dummy[0x30]; | 22 char dummy[0x30]; |
22 void* peb; | 23 void* peb; |
23 }; | 24 }; |
24 | 25 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 curr_rva += descr.DataSize; | 271 curr_rva += descr.DataSize; |
271 } | 272 } |
272 } | 273 } |
273 | 274 |
274 | 275 |
275 | 276 |
276 return false; | 277 return false; |
277 } | 278 } |
278 | 279 |
279 protected: | 280 protected: |
280 ScopedHandle dump_file_handle_; | 281 base::win::ScopedHandle dump_file_handle_; |
281 ScopedHandle dump_file_mapping_; | 282 base::win::ScopedHandle dump_file_mapping_; |
282 void* dump_file_view_; | 283 void* dump_file_view_; |
283 | 284 |
284 FilePath dump_file_; | 285 FilePath dump_file_; |
285 }; | 286 }; |
286 | 287 |
287 TEST_F(MinidumpTest, Version) { | 288 TEST_F(MinidumpTest, Version) { |
288 API_VERSION* version = ::ImagehlpApiVersion(); | 289 API_VERSION* version = ::ImagehlpApiVersion(); |
289 | 290 |
290 VLOG(1) << "Imagehlp Api Version: " << version->MajorVersion << "." | 291 VLOG(1) << "Imagehlp Api Version: " << version->MajorVersion << "." |
291 << version->MinorVersion << "." << version->Revision; | 292 << version->MinorVersion << "." << version->Revision; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 int main(int argc, char** argv) { | 433 int main(int argc, char** argv) { |
433 testing::InitGoogleTest(&argc, argv); | 434 testing::InitGoogleTest(&argc, argv); |
434 CommandLine::Init(argc, argv); | 435 CommandLine::Init(argc, argv); |
435 | 436 |
436 logging::InitLogging(L"CON", | 437 logging::InitLogging(L"CON", |
437 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG, | 438 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG, |
438 logging::DONT_LOCK_LOG_FILE, | 439 logging::DONT_LOCK_LOG_FILE, |
439 logging::APPEND_TO_OLD_LOG_FILE); | 440 logging::APPEND_TO_OLD_LOG_FILE); |
440 return RUN_ALL_TESTS(); | 441 return RUN_ALL_TESTS(); |
441 } | 442 } |
OLD | NEW |