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

Side by Side Diff: snapshot/win/pe_image_annotations_reader_test.cc

Issue 1326443007: win: Fix incorrect thread suspend count due to ScopedProcessSuspend (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: assert some threads captured Created 5 years, 3 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
« no previous file with comments | « snapshot/win/exception_snapshot_win_test.cc ('k') | snapshot/win/pe_image_reader_test.cc » ('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 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 class TestPEImageAnnotationsReader final : public WinMultiprocess { 48 class TestPEImageAnnotationsReader final : public WinMultiprocess {
49 public: 49 public:
50 TestPEImageAnnotationsReader() {} 50 TestPEImageAnnotationsReader() {}
51 ~TestPEImageAnnotationsReader() {} 51 ~TestPEImageAnnotationsReader() {}
52 52
53 private: 53 private:
54 // WinMultiprocess: 54 // WinMultiprocess:
55 55
56 void WinMultiprocessParent() override { 56 void WinMultiprocessParent() override {
57 ProcessReaderWin process_reader; 57 ProcessReaderWin process_reader;
58 ASSERT_TRUE(process_reader.Initialize(ChildProcess())); 58 ASSERT_TRUE(process_reader.Initialize(ChildProcess(),
59 ProcessSuspensionState::kRunning));
59 60
60 // Wait for the child process to indicate that it's done setting up its 61 // Wait for the child process to indicate that it's done setting up its
61 // annotations via the CrashpadInfo interface. 62 // annotations via the CrashpadInfo interface.
62 char c; 63 char c;
63 CheckedReadFile(ReadPipeHandle(), &c, sizeof(c)); 64 CheckedReadFile(ReadPipeHandle(), &c, sizeof(c));
64 65
65 // Verify the "simple map" annotations set via the CrashpadInfo interface. 66 // Verify the "simple map" annotations set via the CrashpadInfo interface.
66 const std::vector<ProcessInfo::Module>& modules = process_reader.Modules(); 67 const std::vector<ProcessInfo::Module>& modules = process_reader.Modules();
67 std::map<std::string, std::string> all_annotations_simple_map; 68 std::map<std::string, std::string> all_annotations_simple_map;
68 for (const ProcessInfo::Module& module : modules) { 69 for (const ProcessInfo::Module& module : modules) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 WinMultiprocess::Run<TestPEImageAnnotationsReader<kDontCrash>>(); 132 WinMultiprocess::Run<TestPEImageAnnotationsReader<kDontCrash>>();
132 } 133 }
133 134
134 TEST(PEImageAnnotationsReader, CrashDebugBreak) { 135 TEST(PEImageAnnotationsReader, CrashDebugBreak) {
135 WinMultiprocess::Run<TestPEImageAnnotationsReader<kCrashDebugBreak>>(); 136 WinMultiprocess::Run<TestPEImageAnnotationsReader<kCrashDebugBreak>>();
136 } 137 }
137 138
138 } // namespace 139 } // namespace
139 } // namespace test 140 } // namespace test
140 } // namespace crashpad 141 } // namespace crashpad
OLDNEW
« no previous file with comments | « snapshot/win/exception_snapshot_win_test.cc ('k') | snapshot/win/pe_image_reader_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698