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

Unified Diff: sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc

Issue 1424323002: Removes support for using the system clock on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test Created 5 years, 2 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 | « sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
index aaed480d6996389bad8d91514861d177f37be1c2..5c3f785d070de5defa8238db35ab57763d7262f4 100644
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
@@ -92,41 +92,7 @@ BPF_DEATH_TEST_C(ParameterRestrictions,
clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
}
-#if defined(OS_CHROMEOS)
-
-// A custom BPF tester delegate to run IsRunningOnChromeOS() before
-// the sandbox is enabled because we cannot run it with non-SFI BPF
-// sandbox enabled.
-class ClockSystemTesterDelegate : public sandbox::BPFTesterDelegate {
- public:
- ClockSystemTesterDelegate()
- : is_running_on_chromeos_(base::SysInfo::IsRunningOnChromeOS()) {}
- ~ClockSystemTesterDelegate() override {}
-
- scoped_ptr<sandbox::bpf_dsl::Policy> GetSandboxBPFPolicy() override {
- return scoped_ptr<sandbox::bpf_dsl::Policy>(new RestrictClockIdPolicy());
- }
- void RunTestFunction() override {
- if (is_running_on_chromeos_) {
- CheckClock(base::TraceTicks::kClockSystemTrace);
- } else {
- struct timespec ts;
- // kClockSystemTrace is 11, which is CLOCK_THREAD_CPUTIME_ID of
- // the init process (pid=1). If kernel supports this feature,
- // this may succeed even if this is not running on Chrome OS. We
- // just check this clock_gettime call does not crash.
- clock_gettime(base::TraceTicks::kClockSystemTrace, &ts);
- }
- }
-
- private:
- const bool is_running_on_chromeos_;
- DISALLOW_COPY_AND_ASSIGN(ClockSystemTesterDelegate);
-};
-
-BPF_TEST_D(BPFTest, BPFTestWithDelegateClass, ClockSystemTesterDelegate);
-
-#elif defined(OS_LINUX)
+#if defined(OS_LINUX)
BPF_DEATH_TEST_C(ParameterRestrictions,
clock_gettime_crash_system_trace,
@@ -136,7 +102,7 @@ BPF_DEATH_TEST_C(ParameterRestrictions,
clock_gettime(base::TraceTicks::kClockSystemTrace, &ts);
}
-#endif // defined(OS_CHROMEOS)
+#endif // defined(OS_LINUX)
#if !defined(OS_ANDROID)
BPF_DEATH_TEST_C(ParameterRestrictions,
« no previous file with comments | « sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698