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

Unified Diff: sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc

Issue 10837178: Seccomp: always call setSandboxPolicy in unittest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc
index a0d86ccd783de2d64f97eddbe62825ca45787c9f..b8ae3b72407fc94883b22cf06043d23f16415bd9 100644
--- a/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc
+++ b/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc
@@ -75,7 +75,7 @@ void StartSandboxOrDie(Sandbox::EvaluateSyscall evaluator) {
void RunInSandbox(Sandbox::EvaluateSyscall evaluator,
void (*SandboxedCode)()) {
- // TODO(jln): Implement IsEqual for ErrorCode
+ // TODO(markus): Implement IsEqual for ErrorCode
// IsEqual(evaluator(__NR_exit_group), Sandbox::SB_ALLOWED) <<
// "You need to always allow exit_group() in your test policy";
StartSandboxOrDie(evaluator);
@@ -97,6 +97,11 @@ void TryPolicyInProcess(Sandbox::EvaluateSyscall evaluator,
EXPECT_EXIT(RunInSandbox(evaluator, SandboxedCode),
::testing::ExitedWithCode(kExpectedReturnValue),
"");
+ } else {
+ // The sandbox is not available. We should still try to exercise what we
+ // can.
+ // TODO(markus): (crbug.com/141545) let us call the compiler from here.
+ Sandbox::setSandboxPolicy(evaluator, NULL);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698