OLD | NEW |
| (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. | |
OLD | NEW |