Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: base/test/multiprocess_test_android.cc

Issue 10408081: Provide android specific implementation for MultiProcessTest::SpawnChildImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/test/multiprocess_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/test/multiprocess_test.h"
6
7 #include <unistd.h>
8
9 #include "base/logging.h"
10 #include "base/process.h"
11 #include "testing/multiprocess_func_list.h"
12
13 namespace base {
14
15 // A very basic implementation for android. On Android tests can run in an APK
16 // and we don't have an executable to exec*. This implementation does the bare
17 // minimum to execute the method specified by procname (in the child process).
18 // - File descriptors are not closed and hence |fds_to_map| is ignored.
19 // - |debug_on_start| is ignored.
20 ProcessHandle MultiProcessTest::SpawnChildImpl(
21 const std::string& procname,
22 const FileHandleMappingVector& fds_to_map,
23 bool debug_on_start) {
24 pid_t pid = fork();
25
26 if (pid < 0) {
27 DPLOG(ERROR) << "fork";
28 return kNullProcessHandle;
29 } else if (pid == 0) {
30 // Child process
Paweł Hajdan Jr. 2012/05/29 08:32:12 nit: Dot at the end: http://google-styleguide.goog
nilesh 2012/05/29 16:55:03 Done.
31 int ret = multi_process_function_list::InvokeChildProcessTest(procname);
Paweł Hajdan Jr. 2012/05/29 08:32:12 nit: No need for temporary int ret, why not just _
nilesh 2012/05/29 16:55:03 Done.
32 _exit(ret);
33 }
34
35 // Parent process
Paweł Hajdan Jr. 2012/05/29 08:32:12 nit: Dot at the end.
nilesh 2012/05/29 16:55:03 Done.
36 return pid;
37 }
38
39 } // namespace base
OLDNEW
« no previous file with comments | « base/test/multiprocess_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698