| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |