| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/edk/test/multiprocess_test_helper.h" | 5 #include "mojo/edk/test/multiprocess_test_helper.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "mojo/edk/embedder/scoped_platform_handle.h" | 9 #include "mojo/edk/embedder/scoped_platform_handle.h" |
| 10 #include "mojo/edk/test/test_utils.h" | 10 #include "mojo/edk/test/test_utils.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 BlockingWrite(handle, &c, 1, &bytes_written); | 33 BlockingWrite(handle, &c, 1, &bytes_written); |
| 34 return bytes_written == 1; | 34 return bytes_written == 1; |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool ReadByte(const embedder::PlatformHandle& handle, char* c) { | 37 bool ReadByte(const embedder::PlatformHandle& handle, char* c) { |
| 38 size_t bytes_read = 0; | 38 size_t bytes_read = 0; |
| 39 BlockingRead(handle, c, 1, &bytes_read); | 39 BlockingRead(handle, c, 1, &bytes_read); |
| 40 return bytes_read == 1; | 40 return bytes_read == 1; |
| 41 } | 41 } |
| 42 | 42 |
| 43 typedef testing::Test MultiprocessTestHelperTest; | 43 using MultiprocessTestHelperTest = testing::Test; |
| 44 | 44 |
| 45 #if defined(OS_ANDROID) | 45 #if defined(OS_ANDROID) |
| 46 // Android multi-process tests are not executing the new process. This is flaky. | 46 // Android multi-process tests are not executing the new process. This is flaky. |
| 47 #define MAYBE_RunChild DISABLED_RunChild | 47 #define MAYBE_RunChild DISABLED_RunChild |
| 48 #else | 48 #else |
| 49 #define MAYBE_RunChild RunChild | 49 #define MAYBE_RunChild RunChild |
| 50 #endif // defined(OS_ANDROID) | 50 #endif // defined(OS_ANDROID) |
| 51 TEST_F(MultiprocessTestHelperTest, MAYBE_RunChild) { | 51 TEST_F(MultiprocessTestHelperTest, MAYBE_RunChild) { |
| 52 MultiprocessTestHelper helper; | 52 MultiprocessTestHelper helper; |
| 53 EXPECT_TRUE(helper.server_platform_handle.is_valid()); | 53 EXPECT_TRUE(helper.server_platform_handle.is_valid()); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 EXPECT_FALSE(MultiprocessTestHelper::client_platform_handle.is_valid()) | 185 EXPECT_FALSE(MultiprocessTestHelper::client_platform_handle.is_valid()) |
| 186 << "DISREGARD: Expected failure #1 in child process"; | 186 << "DISREGARD: Expected failure #1 in child process"; |
| 187 EXPECT_FALSE( | 187 EXPECT_FALSE( |
| 188 IsNonBlocking(MultiprocessTestHelper::client_platform_handle.get())) | 188 IsNonBlocking(MultiprocessTestHelper::client_platform_handle.get())) |
| 189 << "DISREGARD: Expected failure #2 in child process"; | 189 << "DISREGARD: Expected failure #2 in child process"; |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace | 192 } // namespace |
| 193 } // namespace test | 193 } // namespace test |
| 194 } // namespace mojo | 194 } // namespace mojo |
| OLD | NEW |