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

Side by Side Diff: sandbox/linux/suid/client/setuid_sandbox_client_unittest.cc

Issue 236083002: Linux sandbox: style cleanup for setuid sandbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Also fix header inclusions. Ohh goodness. Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
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/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "sandbox/linux/suid/client/setuid_sandbox_client.h"
10 #include "sandbox/linux/suid/common/sandbox.h"
9 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
10 12
11 #include "sandbox/linux/suid/common/sandbox.h"
12 #include "setuid_sandbox_client.h"
13
14 namespace sandbox { 13 namespace sandbox {
15 14
16 TEST(SetuidSandboxClient, SetupLaunchEnvironment) { 15 TEST(SetuidSandboxClient, SetupLaunchEnvironment) {
17 const char kTestValue[] = "This is a test"; 16 const char kTestValue[] = "This is a test";
18 scoped_ptr<base::Environment> env(base::Environment::Create()); 17 scoped_ptr<base::Environment> env(base::Environment::Create());
19 EXPECT_TRUE(env != NULL); 18 EXPECT_TRUE(env != NULL);
20 19
21 std::string saved_ld_preload; 20 std::string saved_ld_preload;
22 bool environment_had_ld_preload; 21 bool environment_had_ld_preload;
23 // First, back-up the real LD_PRELOAD if any. 22 // First, back-up the real LD_PRELOAD if any.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 EXPECT_TRUE(env->SetVar(kSandboxEnvironmentApiProvides, 84 EXPECT_TRUE(env->SetVar(kSandboxEnvironmentApiProvides,
86 base::IntToString(kSUIDSandboxApiNumber + 1))); 85 base::IntToString(kSUIDSandboxApiNumber + 1)));
87 EXPECT_FALSE(sandbox_client->IsSuidSandboxUpToDate()); 86 EXPECT_FALSE(sandbox_client->IsSuidSandboxUpToDate());
88 // We didn't go through the actual sandboxing mechanism as it is 87 // We didn't go through the actual sandboxing mechanism as it is
89 // very hard in a unit test. 88 // very hard in a unit test.
90 EXPECT_FALSE(sandbox_client->IsSandboxed()); 89 EXPECT_FALSE(sandbox_client->IsSandboxed());
91 } 90 }
92 91
93 } // namespace sandbox 92 } // namespace sandbox
94 93
OLDNEW
« no previous file with comments | « sandbox/linux/suid/client/setuid_sandbox_client.cc ('k') | sandbox/linux/suid/common/suid_unsafe_environment_variables.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698