OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file contains unit tests for the RestrictedToken. | 5 // This file contains unit tests for the RestrictedToken. |
6 | 6 |
7 #define _ATL_NO_EXCEPTIONS | 7 #define _ATL_NO_EXCEPTIONS |
8 #include <atlbase.h> | 8 #include <atlbase.h> |
9 #include <atlsecurity.h> | 9 #include <atlsecurity.h> |
10 #include <vector> | 10 #include <vector> |
11 #include "sandbox/src/restricted_token.h" | 11 #include "sandbox/win/src/restricted_token.h" |
12 #include "sandbox/src/sid.h" | 12 #include "sandbox/win/src/sid.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace sandbox { | 15 namespace sandbox { |
16 | 16 |
17 // Tests the initializatioin with an invalid token handle. | 17 // Tests the initializatioin with an invalid token handle. |
18 TEST(RestrictedTokenTest, InvalidHandle) { | 18 TEST(RestrictedTokenTest, InvalidHandle) { |
19 RestrictedToken token; | 19 RestrictedToken token; |
20 ASSERT_EQ(ERROR_INVALID_HANDLE, token.Init(reinterpret_cast<HANDLE>(0x5555))); | 20 ASSERT_EQ(ERROR_INVALID_HANDLE, token.Init(reinterpret_cast<HANDLE>(0x5555))); |
21 } | 21 } |
22 | 22 |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 TEST(RestrictedTokenTest, DoubleInit) { | 521 TEST(RestrictedTokenTest, DoubleInit) { |
522 RestrictedToken token; | 522 RestrictedToken token; |
523 ASSERT_EQ(ERROR_SUCCESS, token.Init(NULL)); | 523 ASSERT_EQ(ERROR_SUCCESS, token.Init(NULL)); |
524 | 524 |
525 ASSERT_EQ(ERROR_ALREADY_INITIALIZED, token.Init(NULL)); | 525 ASSERT_EQ(ERROR_ALREADY_INITIALIZED, token.Init(NULL)); |
526 } | 526 } |
527 | 527 |
528 #endif | 528 #endif |
529 | 529 |
530 } // namespace sandbox | 530 } // namespace sandbox |
OLD | NEW |