| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 class ScopedProcessSuspendTest final : public WinChildProcess { | 75 class ScopedProcessSuspendTest final : public WinChildProcess { |
| 76 public: | 76 public: |
| 77 ScopedProcessSuspendTest() : WinChildProcess() {} | 77 ScopedProcessSuspendTest() : WinChildProcess() {} |
| 78 ~ScopedProcessSuspendTest() {} | 78 ~ScopedProcessSuspendTest() {} |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 int Run() override { | 81 int Run() override { |
| 82 char c; | 82 char c; |
| 83 // Wait for notification from parent. | 83 // Wait for notification from parent. |
| 84 EXPECT_TRUE(LoggingReadFileExactly(ReadPipeHandle(), &c, sizeof(c))); | 84 EXPECT_TRUE(LoggingReadFileExactly(ReadPipeHandle(), &c, sizeof(c))); |
| 85 EXPECT_EQ(' ', c); | 85 EXPECT_EQ(c, ' '); |
| 86 return EXIT_SUCCESS; | 86 return EXIT_SUCCESS; |
| 87 } | 87 } |
| 88 | 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(ScopedProcessSuspendTest); | 89 DISALLOW_COPY_AND_ASSIGN(ScopedProcessSuspendTest); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 TEST(ScopedProcessSuspend, ScopedProcessSuspend) { | 92 TEST(ScopedProcessSuspend, ScopedProcessSuspend) { |
| 93 WinChildProcess::EntryPoint<ScopedProcessSuspendTest>(); | 93 WinChildProcess::EntryPoint<ScopedProcessSuspendTest>(); |
| 94 std::unique_ptr<WinChildProcess::Handles> handles = WinChildProcess::Launch(); | 94 std::unique_ptr<WinChildProcess::Handles> handles = WinChildProcess::Launch(); |
| 95 | 95 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 110 EXPECT_TRUE(SuspendCountMatches(handles->process.get(), 0)); | 110 EXPECT_TRUE(SuspendCountMatches(handles->process.get(), 0)); |
| 111 | 111 |
| 112 // Tell the child it's OK to terminate. | 112 // Tell the child it's OK to terminate. |
| 113 char c = ' '; | 113 char c = ' '; |
| 114 EXPECT_TRUE(WriteFile(handles->write.get(), &c, sizeof(c))); | 114 EXPECT_TRUE(WriteFile(handles->write.get(), &c, sizeof(c))); |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace | 117 } // namespace |
| 118 } // namespace test | 118 } // namespace test |
| 119 } // namespace crashpad | 119 } // namespace crashpad |
| OLD | NEW |