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

Unified Diff: sandbox/linux/services/namespace_sandbox_unittest.cc

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Merge Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: sandbox/linux/services/namespace_sandbox_unittest.cc
diff --git a/sandbox/linux/services/namespace_sandbox_unittest.cc b/sandbox/linux/services/namespace_sandbox_unittest.cc
index c1acca678eac11570798b217c7608b2eeb79725d..8f6a23143bb38abe7bffc2c8509eccceeccd255a 100644
--- a/sandbox/linux/services/namespace_sandbox_unittest.cc
+++ b/sandbox/linux/services/namespace_sandbox_unittest.cc
@@ -51,12 +51,11 @@ class NamespaceSandboxTest : public base::MultiProcessTest {
return;
}
- base::FileHandleMappingVector fds_to_remap = {
- std::make_pair(STDOUT_FILENO, STDOUT_FILENO),
- std::make_pair(STDERR_FILENO, STDERR_FILENO),
- };
base::LaunchOptions launch_options;
- launch_options.fds_to_remap = &fds_to_remap;
+ launch_options.fds_to_remap.push_back(
+ std::make_pair(STDOUT_FILENO, STDOUT_FILENO));
+ launch_options.fds_to_remap.push_back(
+ std::make_pair(STDERR_FILENO, STDERR_FILENO));
base::Process process = NamespaceSandbox::LaunchProcessWithOptions(
MakeCmdLine(procname), launch_options, ns_sandbox_options);
@@ -123,12 +122,12 @@ TEST_F(NamespaceSandboxTest, DISABLE_ON_ASAN(ChrootAndDropCapabilities)) {
}
MULTIPROCESS_TEST_MAIN(NestedNamespaceSandbox) {
- base::FileHandleMappingVector fds_to_remap = {
- std::make_pair(STDOUT_FILENO, STDOUT_FILENO),
- std::make_pair(STDERR_FILENO, STDERR_FILENO),
- };
base::LaunchOptions launch_options;
- launch_options.fds_to_remap = &fds_to_remap;
+ launch_options.fds_to_remap.push_back(
+ std::make_pair(STDOUT_FILENO, STDOUT_FILENO));
+ launch_options.fds_to_remap.push_back(
+ std::make_pair(STDERR_FILENO, STDERR_FILENO));
+
base::Process process = NamespaceSandbox::LaunchProcess(
base::CommandLine(base::FilePath("/bin/true")), launch_options);
CHECK(process.IsValid());
« no previous file with comments | « net/test/spawned_test_server/local_test_server_win.cc ('k') | sandbox/linux/suid/client/setuid_sandbox_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698