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

Side by Side Diff: sandbox/linux/services/credentials_unittest.cc

Issue 55603003: Linux: add a Credentials class to handle Linux capabilities. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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
« no previous file with comments | « sandbox/linux/services/credentials.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "sandbox/linux/services/credentials.h"
6
7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "sandbox/linux/tests/unit_tests.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 namespace sandbox {
13
14 // Give dynamic tools a simple thing to test.
15 TEST(Credentials, CreateAndDestroy) {
16 {
17 Credentials cred1;
18 (void) cred1;
19 }
20 scoped_ptr<Credentials> cred2(new Credentials);
21 }
22
23 SANDBOX_TEST(Credentials, DropAllCaps) {
24 Credentials creds;
25 creds.DropAllCapabilities();
26 SANDBOX_ASSERT(!creds.HasAnyCapability());
27 }
28
29 SANDBOX_TEST(Credentials, GetCurrentCapString) {
30 Credentials creds;
31 creds.DropAllCapabilities();
32 const char kNoCapabilityText[] = "=";
33 SANDBOX_ASSERT(*creds.GetCurrentCapString() == kNoCapabilityText);
34 }
35
36 } // namespace sandbox.
OLDNEW
« no previous file with comments | « sandbox/linux/services/credentials.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698