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/string_number_conversions.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Check the API. | 66 // Check the API. |
67 EXPECT_TRUE(sandbox_client->IsSuidSandboxUpToDate()); | 67 EXPECT_TRUE(sandbox_client->IsSuidSandboxUpToDate()); |
68 EXPECT_TRUE(sandbox_client->IsSuidSandboxChild()); | 68 EXPECT_TRUE(sandbox_client->IsSuidSandboxChild()); |
69 EXPECT_TRUE(sandbox_client->IsInNewPIDNamespace()); | 69 EXPECT_TRUE(sandbox_client->IsInNewPIDNamespace()); |
70 EXPECT_FALSE(sandbox_client->IsInNewNETNamespace()); | 70 EXPECT_FALSE(sandbox_client->IsInNewNETNamespace()); |
71 | 71 |
72 // Forge an incorrect API version and check. | 72 // Forge an incorrect API version and check. |
73 EXPECT_TRUE(env->SetVar(kSandboxEnvironmentApiProvides, | 73 EXPECT_TRUE(env->SetVar(kSandboxEnvironmentApiProvides, |
74 base::IntToString(kSUIDSandboxApiNumber + 1))); | 74 base::IntToString(kSUIDSandboxApiNumber + 1))); |
75 EXPECT_FALSE(sandbox_client->IsSuidSandboxUpToDate()); | 75 EXPECT_FALSE(sandbox_client->IsSuidSandboxUpToDate()); |
| 76 // We didn't go through the actual sandboxing mechanism as it is |
| 77 // very hard in a unit test. |
| 78 EXPECT_FALSE(sandbox_client->IsSandboxed()); |
76 } | 79 } |
77 | 80 |
78 } // namespace sandbox | 81 } // namespace sandbox |
OLD | NEW |