| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 // Wait for the parent to signal that it's OK to exit by closing its end of | 79 // Wait for the parent to signal that it's OK to exit by closing its end of |
| 80 // the pipe. | 80 // the pipe. |
| 81 CheckedReadFileAtEOF(ReadPipeHandle()); | 81 CheckedReadFileAtEOF(ReadPipeHandle()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(ProcessReaderChild); | 84 DISALLOW_COPY_AND_ASSIGN(ProcessReaderChild); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 TEST(ProcessReaderWin, ChildBasic) { | 87 TEST(ProcessReaderWin, ChildBasic) { |
| 88 ProcessReaderChild process_reader_child; | 88 WinMultiprocess::Run<ProcessReaderChild>(); |
| 89 process_reader_child.Run(); | |
| 90 } | 89 } |
| 91 | 90 |
| 92 TEST(ProcessReaderWin, SelfOneThread) { | 91 TEST(ProcessReaderWin, SelfOneThread) { |
| 93 ProcessReaderWin process_reader; | 92 ProcessReaderWin process_reader; |
| 94 ASSERT_TRUE(process_reader.Initialize(GetCurrentProcess())); | 93 ASSERT_TRUE(process_reader.Initialize(GetCurrentProcess())); |
| 95 | 94 |
| 96 const std::vector<ProcessReaderWin::Thread>& threads = | 95 const std::vector<ProcessReaderWin::Thread>& threads = |
| 97 process_reader.Threads(); | 96 process_reader.Threads(); |
| 98 | 97 |
| 99 // If other tests ran in this process previously, threads may have been | 98 // If other tests ran in this process previously, threads may have been |
| 100 // created and may still be running. This check must look for at least one | 99 // created and may still be running. This check must look for at least one |
| 101 // thread, not exactly one thread. | 100 // thread, not exactly one thread. |
| 102 ASSERT_GE(threads.size(), 1u); | 101 ASSERT_GE(threads.size(), 1u); |
| 103 | 102 |
| 104 EXPECT_EQ(GetThreadId(GetCurrentThread()), threads[0].id); | 103 EXPECT_EQ(GetThreadId(GetCurrentThread()), threads[0].id); |
| 105 #if defined(ARCH_CPU_64_BITS) | 104 #if defined(ARCH_CPU_64_BITS) |
| 106 EXPECT_NE(0, threads[0].context.Rip); | 105 EXPECT_NE(0, threads[0].context.Rip); |
| 107 #else | 106 #else |
| 108 EXPECT_NE(0, threads[0].context.Eip); | 107 EXPECT_NE(0, threads[0].context.Eip); |
| 109 #endif | 108 #endif |
| 110 | 109 |
| 111 EXPECT_EQ(0, threads[0].suspend_count); | 110 EXPECT_EQ(0, threads[0].suspend_count); |
| 112 } | 111 } |
| 113 | 112 |
| 114 } // namespace | 113 } // namespace |
| 115 } // namespace test | 114 } // namespace test |
| 116 } // namespace crashpad | 115 } // namespace crashpad |
| OLD | NEW |