| 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/common/test/multiprocess_test_base.h" | 5 #include "mojo/common/test/multiprocess_test_base.h" |
| 6 | 6 |
| 7 #include "base/logging.h" |
| 8 // TODO(vtl): Remove build_config.h include when fully implemented on Windows. |
| 9 #include "build/build_config.h" |
| 10 |
| 7 namespace mojo { | 11 namespace mojo { |
| 8 namespace { | 12 namespace { |
| 9 | 13 |
| 10 class MultiprocessTestBaseTest : public test::MultiprocessTestBase { | 14 class MultiprocessTestBaseTest : public test::MultiprocessTestBase { |
| 11 }; | 15 }; |
| 12 | 16 |
| 13 TEST_F(MultiprocessTestBaseTest, RunChild) { | 17 TEST_F(MultiprocessTestBaseTest, RunChild) { |
| 14 StartChild("RunChild"); | 18 StartChild("RunChild"); |
| 15 EXPECT_EQ(123, WaitForChildShutdown()); | 19 EXPECT_EQ(123, WaitForChildShutdown()); |
| 16 } | 20 } |
| 17 | 21 |
| 18 MOJO_MULTIPROCESS_TEST_CHILD_MAIN(RunChild) { | 22 MOJO_MULTIPROCESS_TEST_CHILD_MAIN(RunChild) { |
| 23 // TODO(vtl): Not implemented on Windows yet. |
| 24 #if defined(OS_POSIX) |
| 25 CHECK(MultiprocessTestBaseTest::platform_client_channel.get()); |
| 26 CHECK(MultiprocessTestBaseTest::platform_client_channel->is_valid()); |
| 27 // TODO(vtl): Check the client channel. |
| 28 #endif |
| 19 return 123; | 29 return 123; |
| 20 } | 30 } |
| 21 | 31 |
| 22 TEST_F(MultiprocessTestBaseTest, TestChildMainNotFound) { | 32 TEST_F(MultiprocessTestBaseTest, TestChildMainNotFound) { |
| 23 StartChild("NoSuchTestChildMain"); | 33 StartChild("NoSuchTestChildMain"); |
| 24 int result = WaitForChildShutdown(); | 34 int result = WaitForChildShutdown(); |
| 25 EXPECT_FALSE(result >= 0 && result <= 127); | 35 EXPECT_FALSE(result >= 0 && result <= 127); |
| 26 } | 36 } |
| 27 | 37 |
| 28 } // namespace | 38 } // namespace |
| 29 } // namespace mojo | 39 } // namespace mojo |
| OLD | NEW |