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 20 matching lines...) Expand all Loading... |
31 ProcessReaderWin process_reader; | 31 ProcessReaderWin process_reader; |
32 ASSERT_TRUE(process_reader.Initialize(GetCurrentProcess(), | 32 ASSERT_TRUE(process_reader.Initialize(GetCurrentProcess(), |
33 ProcessSuspensionState::kRunning)); | 33 ProcessSuspensionState::kRunning)); |
34 | 34 |
35 #if !defined(ARCH_CPU_64_BITS) | 35 #if !defined(ARCH_CPU_64_BITS) |
36 EXPECT_FALSE(process_reader.Is64Bit()); | 36 EXPECT_FALSE(process_reader.Is64Bit()); |
37 #else | 37 #else |
38 EXPECT_TRUE(process_reader.Is64Bit()); | 38 EXPECT_TRUE(process_reader.Is64Bit()); |
39 #endif | 39 #endif |
40 | 40 |
41 EXPECT_EQ(GetCurrentProcessId(), process_reader.ProcessID()); | 41 EXPECT_EQ(GetCurrentProcessId(), process_reader.GetProcessInfo().ProcessID()); |
42 | 42 |
43 const char kTestMemory[] = "Some test memory"; | 43 const char kTestMemory[] = "Some test memory"; |
44 char buffer[arraysize(kTestMemory)]; | 44 char buffer[arraysize(kTestMemory)]; |
45 ASSERT_TRUE( | 45 ASSERT_TRUE( |
46 process_reader.ReadMemory(reinterpret_cast<uintptr_t>(kTestMemory), | 46 process_reader.ReadMemory(reinterpret_cast<uintptr_t>(kTestMemory), |
47 sizeof(kTestMemory), | 47 sizeof(kTestMemory), |
48 &buffer)); | 48 &buffer)); |
49 EXPECT_STREQ(kTestMemory, buffer); | 49 EXPECT_STREQ(kTestMemory, buffer); |
50 } | 50 } |
51 | 51 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 DISALLOW_COPY_AND_ASSIGN(ProcessReaderChildThreadSuspendCount); | 198 DISALLOW_COPY_AND_ASSIGN(ProcessReaderChildThreadSuspendCount); |
199 }; | 199 }; |
200 | 200 |
201 TEST(ProcessReaderWin, ChildThreadSuspendCounts) { | 201 TEST(ProcessReaderWin, ChildThreadSuspendCounts) { |
202 WinMultiprocess::Run<ProcessReaderChildThreadSuspendCount>(); | 202 WinMultiprocess::Run<ProcessReaderChildThreadSuspendCount>(); |
203 } | 203 } |
204 | 204 |
205 } // namespace | 205 } // namespace |
206 } // namespace test | 206 } // namespace test |
207 } // namespace crashpad | 207 } // namespace crashpad |
OLD | NEW |