summaryrefslogtreecommitdiffstats
path: root/mojo/edk/test/multiprocess_test_helper.h
diff options
context:
space:
mode:
authorblundell <blundell@chromium.org>2015-01-19 09:18:33 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-19 17:19:27 +0000
commit70fb54767b472a5edfb859e489beeeec7abdb0e4 (patch)
tree28e534ec774391a9f6571a1770e12a0d63ebf833 /mojo/edk/test/multiprocess_test_helper.h
parentba5f0233fa38f949e24f6274ba891fa652eab640 (diff)
downloadchromium_src-70fb54767b472a5edfb859e489beeeec7abdb0e4.zip
chromium_src-70fb54767b472a5edfb859e489beeeec7abdb0e4.tar.gz
chromium_src-70fb54767b472a5edfb859e489beeeec7abdb0e4.tar.bz2
Move //mojo/{public, edk} underneath //third_party
This CL move //mojo/public and //mojo/edk to live in the following locations: - //third_party/mojo/src/mojo/public - //third_party/mojo/src/mojo/edk It moves the related gypfiles from //mojo to //third_party/mojo and updates them as necessary to account for the file moves. It also updates clients of the mojo SDK and EDK targets in both GYP and GN. (Note that for GN, the mojo SDK and EDK build systems are maintained in the Mojo repo and designed to be flexible wrt the location of the SDK/EDK in a client repo, so no changes are needed. This CL does not update include paths to the code being moved to limit the number of moving parts, instead relying on the include_dirs that the SDK and EDK targets supply to their direct dependents to ensure that include paths continue to resolve correctly. NOPRESUBMIT=true Review URL: https://codereview.chromium.org/814543006 Cr-Commit-Position: refs/heads/master@{#312129}
Diffstat (limited to 'mojo/edk/test/multiprocess_test_helper.h')
-rw-r--r--mojo/edk/test/multiprocess_test_helper.h92
1 files changed, 0 insertions, 92 deletions
diff --git a/mojo/edk/test/multiprocess_test_helper.h b/mojo/edk/test/multiprocess_test_helper.h
deleted file mode 100644
index e40b309c..0000000
--- a/mojo/edk/test/multiprocess_test_helper.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_
-#define MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_
-
-#include <string>
-
-#include "base/macros.h"
-#include "base/process/process.h"
-#include "base/test/multiprocess_test.h"
-#include "base/test/test_timeouts.h"
-#include "mojo/edk/embedder/scoped_platform_handle.h"
-#include "testing/multiprocess_func_list.h"
-
-namespace mojo {
-
-namespace embedder {
-class PlatformChannelPair;
-}
-
-namespace test {
-
-class MultiprocessTestHelper {
- public:
- MultiprocessTestHelper();
- ~MultiprocessTestHelper();
-
- // Start a child process and run the "main" function "named" |test_child_name|
- // declared using |MOJO_MULTIPROCESS_TEST_CHILD_MAIN()| or
- // |MOJO_MULTIPROCESS_TEST_CHILD_TEST()| (below).
- void StartChild(const std::string& test_child_name);
- // Wait for the child process to terminate.
- // Returns the exit code of the child process. Note that, though it's declared
- // to be an |int|, the exit code is subject to mangling by the OS. E.g., we
- // usually return -1 on error in the child (e.g., if |test_child_name| was not
- // found), but this is mangled to 255 on Linux. You should only rely on codes
- // 0-127 being preserved, and -1 being outside the range 0-127.
- int WaitForChildShutdown();
-
- // Like |WaitForChildShutdown()|, but returns true on success (exit code of 0)
- // and false otherwise. You probably want to do something like
- // |EXPECT_TRUE(WaitForChildTestShutdown());|. Mainly for use with
- // |MOJO_MULTIPROCESS_TEST_CHILD_TEST()|.
- bool WaitForChildTestShutdown();
-
- // For use by |MOJO_MULTIPROCESS_TEST_CHILD_MAIN()| only:
- static void ChildSetup();
-
- // For use in the main process:
- embedder::ScopedPlatformHandle server_platform_handle;
-
- // For use (and only valid) in the child process:
- static embedder::ScopedPlatformHandle client_platform_handle;
-
- private:
- scoped_ptr<embedder::PlatformChannelPair> platform_channel_pair_;
-
- // Valid after |StartChild()| and before |WaitForChildShutdown()|.
- base::Process test_child_;
-
- DISALLOW_COPY_AND_ASSIGN(MultiprocessTestHelper);
-};
-
-// Use this to declare the child process's "main()" function for tests using
-// |MultiprocessTestHelper|. It returns an |int|, which will be the process's
-// exit code (but see the comment about |WaitForChildShutdown()|).
-#define MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) \
- MULTIPROCESS_TEST_MAIN_WITH_SETUP( \
- test_child_name##TestChildMain, \
- ::mojo::test::MultiprocessTestHelper::ChildSetup)
-
-// Use this (and |WaitForChildTestShutdown()|) for the child process's "main()",
-// if you want to use |EXPECT_...()| or |ASSERT_...()|; it has a |void| return
-// type. (Note that while an |ASSERT_...()| failure will abort the test in the
-// child, it will not abort the test in the parent.)
-#define MOJO_MULTIPROCESS_TEST_CHILD_TEST(test_child_name) \
- void test_child_name##TestChildTest(); \
- MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) { \
- test_child_name##TestChildTest(); \
- return (::testing::Test::HasFatalFailure() || \
- ::testing::Test::HasNonfatalFailure()) \
- ? 1 \
- : 0; \
- } \
- void test_child_name##TestChildTest()
-
-} // namespace test
-} // namespace mojo
-
-#endif // MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_