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

Side by Side Diff: sandbox/linux/services/resource_limits_unittests.cc

Issue 919203002: Linux Sandbox: add resource limits to NaCl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Correct typo. Created 5 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/linux/services/resource_limits.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 2015 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 "sandbox/linux/services/resource_limits.h"
6
7 #include <errno.h>
8 #include <sys/resource.h>
9 #include <sys/time.h>
10 #include <unistd.h>
11
12 #include "base/logging.h"
13 #include "sandbox/linux/tests/test_utils.h"
14 #include "sandbox/linux/tests/unit_tests.h"
15 #include "testing/gtest/include/gtest/gtest.h"
16
17 namespace sandbox {
18
19 namespace {
20
21 // Not being able to fork breaks LeakSanitizer, so disable on
22 // all ASAN builds.
23 SANDBOX_TEST(ResourceLimits, DISABLE_ON_ASAN(NoFork)) {
24 // Make sure that fork will fail with EAGAIN.
25 SANDBOX_ASSERT(ResourceLimits::Lower(RLIMIT_NPROC, 0));
26 errno = 0;
27 pid_t pid = fork();
28 // Reap any child if fork succeeded.
29 TestUtils::HandlePostForkReturn(pid);
30 SANDBOX_ASSERT_EQ(-1, pid);
31 CHECK_EQ(EAGAIN, errno);
32 }
33
34 } // namespace
35
36 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/linux/services/resource_limits.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698