OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/environment.h" | 5 #include "base/environment.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
11 #include "sandbox/linux/suid/common/sandbox.h" | 11 #include "sandbox/linux/suid/common/sandbox.h" |
12 #include "setuid_sandbox_client.h" | 12 #include "setuid_sandbox_client.h" |
13 | 13 |
14 namespace sandbox { | 14 namespace sandbox { |
15 | 15 |
16 TEST(SetuidSandboxClient, SetupLaunchEnvironment) { | 16 TEST(SetuidSandboxClient, SetupLaunchEnvironment) { |
17 const char kTestValue[] = "This is a test"; | 17 const char kTestValue[] = "This is a test"; |
18 scoped_ptr<base::Environment> env(base::Environment::Create()); | 18 scoped_ptr<base::Environment> env(base::Environment::Create()); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 EXPECT_TRUE(env->SetVar(kSandboxEnvironmentApiProvides, | 85 EXPECT_TRUE(env->SetVar(kSandboxEnvironmentApiProvides, |
86 base::IntToString(kSUIDSandboxApiNumber + 1))); | 86 base::IntToString(kSUIDSandboxApiNumber + 1))); |
87 EXPECT_FALSE(sandbox_client->IsSuidSandboxUpToDate()); | 87 EXPECT_FALSE(sandbox_client->IsSuidSandboxUpToDate()); |
88 // We didn't go through the actual sandboxing mechanism as it is | 88 // We didn't go through the actual sandboxing mechanism as it is |
89 // very hard in a unit test. | 89 // very hard in a unit test. |
90 EXPECT_FALSE(sandbox_client->IsSandboxed()); | 90 EXPECT_FALSE(sandbox_client->IsSandboxed()); |
91 } | 91 } |
92 | 92 |
93 } // namespace sandbox | 93 } // namespace sandbox |
94 | 94 |
OLD | NEW |