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

Side by Side Diff: sandbox/mac/sandbox_mac_compiler_unittest.mm

Issue 2686433002: Move SandboxCompiler class into the sandbox library. (Closed)
Patch Set: Try getting rid of sysctl-read Created 3 years, 10 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
« no previous file with comments | « sandbox/mac/sandbox_compiler.cc ('k') | sandbox/mac/sandbox_mac_compiler_v2_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/common/sandbox_mac.h"
6
7 #include <fcntl.h> 5 #include <fcntl.h>
8 #include <stdint.h> 6 #include <stdint.h>
9 #include <sys/stat.h> 7 #include <sys/stat.h>
10 #include <unistd.h> 8 #include <unistd.h>
11 9
12 #include "base/process/kill.h" 10 #include "base/process/kill.h"
13 #include "base/test/multiprocess_test.h" 11 #include "base/test/multiprocess_test.h"
14 #include "base/test/test_timeouts.h" 12 #include "base/test/test_timeouts.h"
13 #include "sandbox/mac/sandbox_compiler.h"
15 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
16 #include "testing/multiprocess_func_list.h" 15 #include "testing/multiprocess_func_list.h"
17 16
18 namespace content { 17 namespace sandbox {
19 18
20 class SandboxMacCompilerTest : public base::MultiProcessTest {}; 19 class SandboxMacCompilerTest : public base::MultiProcessTest {};
21 20
22 MULTIPROCESS_TEST_MAIN(BasicProfileProcess) { 21 MULTIPROCESS_TEST_MAIN(BasicProfileProcess) {
23 std::string profile = 22 std::string profile =
24 "(version 1)" 23 "(version 1)"
25 "(allow file-read* file-write* (literal \"/\"))"; 24 "(allow file-read* file-write* (literal \"/\"))";
26 25
27 SandboxCompiler compiler(profile); 26 SandboxCompiler compiler(profile);
28 27
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 150
152 TEST_F(SandboxMacCompilerTest, ProfileFunctionalityTestError) { 151 TEST_F(SandboxMacCompilerTest, ProfileFunctionalityTestError) {
153 base::Process process = SpawnChild("ProfileFunctionalityTestErrorProcess"); 152 base::Process process = SpawnChild("ProfileFunctionalityTestErrorProcess");
154 ASSERT_TRUE(process.IsValid()); 153 ASSERT_TRUE(process.IsValid());
155 int exit_code = 42; 154 int exit_code = 42;
156 EXPECT_TRUE(process.WaitForExitWithTimeout(TestTimeouts::action_max_timeout(), 155 EXPECT_TRUE(process.WaitForExitWithTimeout(TestTimeouts::action_max_timeout(),
157 &exit_code)); 156 &exit_code));
158 EXPECT_EQ(exit_code, 0); 157 EXPECT_EQ(exit_code, 0);
159 } 158 }
160 159
161 } // namespace content 160 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/mac/sandbox_compiler.cc ('k') | sandbox/mac/sandbox_mac_compiler_v2_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698