Chromium Code Reviews| Index: util/test/multiprocess_posix_test.cc |
| diff --git a/util/test/multiprocess_test.cc b/util/test/multiprocess_posix_test.cc |
| similarity index 91% |
| rename from util/test/multiprocess_test.cc |
| rename to util/test/multiprocess_posix_test.cc |
| index 4d978e042f02c0c2ff721f0c0def17ee4b43ba14..a23db2cbad52ed813cf7decddb2180a6ced5a765 100644 |
| --- a/util/test/multiprocess_test.cc |
| +++ b/util/test/multiprocess_posix_test.cc |
| @@ -36,7 +36,7 @@ class TestMultiprocess final : public Multiprocess { |
| // Multiprocess: |
| void MultiprocessParent() override { |
| - int read_fd = ReadPipeFD(); |
| + int read_fd = ReadPipeHandle(); |
|
Mark Mentovai
2015/01/28 19:58:28
Same pattern here and on line 57.
scottmg
2015/01/28 22:14:58
Done.
|
| char c; |
| CheckedReadFile(read_fd, &c, 1); |
| EXPECT_EQ('M', c); |
| @@ -46,7 +46,7 @@ class TestMultiprocess final : public Multiprocess { |
| EXPECT_EQ(pid, ChildPID()); |
| c = 'm'; |
| - CheckedWriteFile(WritePipeFD(), &c, 1); |
| + CheckedWriteFile(WritePipeHandle(), &c, 1); |
| // The child will close its end of the pipe and exit. Make sure that the |
| // parent sees EOF. |
| @@ -54,7 +54,7 @@ class TestMultiprocess final : public Multiprocess { |
| } |
| void MultiprocessChild() override { |
| - int write_fd = WritePipeFD(); |
| + int write_fd = WritePipeHandle(); |
| char c = 'M'; |
| CheckedWriteFile(write_fd, &c, 1); |
| @@ -62,7 +62,7 @@ class TestMultiprocess final : public Multiprocess { |
| pid_t pid = getpid(); |
| CheckedWriteFile(write_fd, &pid, sizeof(pid)); |
| - CheckedReadFile(ReadPipeFD(), &c, 1); |
| + CheckedReadFile(ReadPipeHandle(), &c, 1); |
| EXPECT_EQ('m', c); |
| } |
| @@ -160,8 +160,8 @@ class TestMultiprocessClosePipe final : public Multiprocess { |
| private: |
| void VerifyInitial() { |
| - ASSERT_NE(-1, ReadPipeFD()); |
| - ASSERT_NE(-1, WritePipeFD()); |
| + ASSERT_NE(-1, ReadPipeHandle()); |
| + ASSERT_NE(-1, WritePipeHandle()); |
| } |
| // Verifies that the partner process did what it was supposed to do. This must |
| @@ -178,9 +178,9 @@ class TestMultiprocessClosePipe final : public Multiprocess { |
| // the read pipe in this process to show end-of-file. |
| void VerifyPartner() { |
| if (what_closes_ == kWriteCloses) { |
| - CheckedReadFileAtEOF(ReadPipeFD()); |
| + CheckedReadFileAtEOF(ReadPipeHandle()); |
| } else if (what_closes_ == kReadAndWriteClose) { |
| - CheckedReadFileAtEOF(ReadPipeFD()); |
| + CheckedReadFileAtEOF(ReadPipeHandle()); |
| char c = '\0'; |
| // This will raise SIGPIPE. If fatal (the normal case), that will cause |
| @@ -189,7 +189,7 @@ class TestMultiprocessClosePipe final : public Multiprocess { |
| // abort execution. Regardless of how SIGPIPE is handled, the process will |
| // be terminated. Because the actual termination mechanism is not known, |
| // no regex can be specified. |
| - EXPECT_DEATH(CheckedWriteFile(WritePipeFD(), &c, 1), ""); |
| + EXPECT_DEATH(CheckedWriteFile(WritePipeHandle(), &c, 1), ""); |
| } |
| } |
| @@ -197,19 +197,19 @@ class TestMultiprocessClosePipe final : public Multiprocess { |
| switch (what_closes_) { |
| case kReadCloses: |
| CloseReadPipe(); |
| - EXPECT_NE(-1, WritePipeFD()); |
| - EXPECT_DEATH(ReadPipeFD(), "fd"); |
| + EXPECT_NE(-1, WritePipeHandle()); |
| + EXPECT_DEATH(ReadPipeHandle(), "fd"); |
| break; |
| case kWriteCloses: |
| CloseWritePipe(); |
| - EXPECT_NE(-1, ReadPipeFD()); |
| - EXPECT_DEATH(WritePipeFD(), "fd"); |
| + EXPECT_NE(-1, ReadPipeHandle()); |
| + EXPECT_DEATH(WritePipeHandle(), "fd"); |
| break; |
| case kReadAndWriteClose: |
| CloseReadPipe(); |
| CloseWritePipe(); |
| - EXPECT_DEATH(ReadPipeFD(), "fd"); |
| - EXPECT_DEATH(WritePipeFD(), "fd"); |
| + EXPECT_DEATH(ReadPipeHandle(), "fd"); |
| + EXPECT_DEATH(WritePipeHandle(), "fd"); |
| break; |
| } |
| } |