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

Side by Side Diff: src/platform/minijail/minijail_unittest.cc

Issue 465106: Add build and package support to minijail (Closed)
Patch Set: Created 11 years 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
« no previous file with comments | « src/platform/minijail/minijail.cc ('k') | src/scripts/build_platform_packages.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium OS 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 // Some portions Copyright (c) 2009 The Chromium Authors. 4 // Some portions Copyright (c) 2009 The Chromium Authors.
5 // 5 //
6 // Tests for MiniJail 6 // Tests for MiniJail
7 #include "env.h" 7 #include "env.h"
8 #include "minijail.h" 8 #include "minijail.h"
9 #include <gtest/gtest.h> 9 #include <gtest/gtest.h>
10 10
(...skipping 16 matching lines...) Expand all
27 bool Run(const char *path, 27 bool Run(const char *path,
28 char * const *argv, 28 char * const *argv,
29 char * const *envp) const { return true; } 29 char * const *envp) const { return true; }
30 }; 30 };
31 31
32 class MiniJailTest : public ::testing::Test { }; 32 class MiniJailTest : public ::testing::Test { };
33 33
34 TEST(MiniJailTest, TrueJail) { 34 TEST(MiniJailTest, TrueJail) {
35 TrueEnv *env = new TrueEnv; 35 TrueEnv *env = new TrueEnv;
36 MiniJailOptions options; 36 MiniJailOptions options;
37 options.set_env(env); 37 options.set_env(env); // takes ownership
38 options.set_executable_path("/no/where");
38 MiniJail jail; 39 MiniJail jail;
40 jail.Initialize(&options);
39 // This does basically nothing since the options default to false. 41 // This does basically nothing since the options default to false.
40 // Only ChangeUser is actually called. 42 // Only ChangeUser is actually called.
41 EXPECT_TRUE(jail.Jail()); 43 EXPECT_TRUE(jail.Jail());
42 EXPECT_TRUE(jail.Run()); 44 EXPECT_TRUE(jail.Run());
43 } 45 }
44 46
45 } // namespace chromeos 47 } // namespace chromeos
OLDNEW
« no previous file with comments | « src/platform/minijail/minijail.cc ('k') | src/scripts/build_platform_packages.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698