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

Side by Side Diff: minidump/minidump_memory_info_writer_test.cc

Issue 1419623003: Write MINIDUMP_HANDLE_DATA_STREAM to minidump (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 const size_t kDirectoryIndex = 0; 44 const size_t kDirectoryIndex = 0;
45 45
46 ASSERT_EQ(kMinidumpStreamTypeMemoryInfoList, 46 ASSERT_EQ(kMinidumpStreamTypeMemoryInfoList,
47 directory[kDirectoryIndex].StreamType); 47 directory[kDirectoryIndex].StreamType);
48 EXPECT_EQ(kMemoryInfoListStreamOffset, 48 EXPECT_EQ(kMemoryInfoListStreamOffset,
49 directory[kDirectoryIndex].Location.Rva); 49 directory[kDirectoryIndex].Location.Rva);
50 50
51 *memory_info_list = 51 *memory_info_list =
52 MinidumpWritableAtLocationDescriptor<MINIDUMP_MEMORY_INFO_LIST>( 52 MinidumpWritableAtLocationDescriptor<MINIDUMP_MEMORY_INFO_LIST>(
53 file_contents, directory[kDirectoryIndex].Location); 53 file_contents, directory[kDirectoryIndex].Location);
54 ASSERT_TRUE(memory_info_list); 54 ASSERT_TRUE(*memory_info_list);
55 } 55 }
56 56
57 TEST(MinidumpMemoryInfoWriter, Empty) { 57 TEST(MinidumpMemoryInfoWriter, Empty) {
58 MinidumpFileWriter minidump_file_writer; 58 MinidumpFileWriter minidump_file_writer;
59 auto memory_info_list_writer = 59 auto memory_info_list_writer =
60 make_scoped_ptr(new MinidumpMemoryInfoListWriter()); 60 make_scoped_ptr(new MinidumpMemoryInfoListWriter());
61 minidump_file_writer.AddStream(memory_info_list_writer.Pass()); 61 minidump_file_writer.AddStream(memory_info_list_writer.Pass());
62 62
63 StringFile string_file; 63 StringFile string_file;
64 ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file)); 64 ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 EXPECT_EQ(mmi.AllocationProtect, memory_info->AllocationProtect); 117 EXPECT_EQ(mmi.AllocationProtect, memory_info->AllocationProtect);
118 EXPECT_EQ(mmi.RegionSize, memory_info->RegionSize); 118 EXPECT_EQ(mmi.RegionSize, memory_info->RegionSize);
119 EXPECT_EQ(mmi.State, memory_info->State); 119 EXPECT_EQ(mmi.State, memory_info->State);
120 EXPECT_EQ(mmi.Protect, memory_info->Protect); 120 EXPECT_EQ(mmi.Protect, memory_info->Protect);
121 EXPECT_EQ(mmi.Type, memory_info->Type); 121 EXPECT_EQ(mmi.Type, memory_info->Type);
122 } 122 }
123 123
124 } // namespace 124 } // namespace
125 } // namespace test 125 } // namespace test
126 } // namespace crashpad 126 } // namespace crashpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698