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

Side by Side Diff: sandbox/win/src/restricted_token_unittest.cc

Issue 109843003: Replace wstring with string16 in sandbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « sandbox/win/src/restricted_token.cc ('k') | sandbox/win/src/restricted_token_utils.cc » ('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) 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 // 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>
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 ASSERT_TRUE(restricted_token.GetPrivileges(&privileges)); 346 ASSERT_TRUE(restricted_token.GetPrivileges(&privileges));
347 347
348 ASSERT_EQ(0, privileges.GetCount()); 348 ASSERT_EQ(0, privileges.GetCount());
349 } 349 }
350 350
351 // Tests the method DeleteAllPrivileges with an exception list. 351 // Tests the method DeleteAllPrivileges with an exception list.
352 TEST(RestrictedTokenTest, DeleteAllPrivilegesException) { 352 TEST(RestrictedTokenTest, DeleteAllPrivilegesException) {
353 RestrictedToken token; 353 RestrictedToken token;
354 HANDLE token_handle = NULL; 354 HANDLE token_handle = NULL;
355 355
356 std::vector<std::wstring> exceptions; 356 std::vector<base::string16> exceptions;
357 exceptions.push_back(SE_CHANGE_NOTIFY_NAME); 357 exceptions.push_back(SE_CHANGE_NOTIFY_NAME);
358 358
359 ASSERT_EQ(ERROR_SUCCESS, token.Init(NULL)); 359 ASSERT_EQ(ERROR_SUCCESS, token.Init(NULL));
360 ASSERT_EQ(ERROR_SUCCESS, token.DeleteAllPrivileges(&exceptions)); 360 ASSERT_EQ(ERROR_SUCCESS, token.DeleteAllPrivileges(&exceptions));
361 ASSERT_EQ(ERROR_SUCCESS, token.GetRestrictedTokenHandle(&token_handle)); 361 ASSERT_EQ(ERROR_SUCCESS, token.GetRestrictedTokenHandle(&token_handle));
362 362
363 ATL::CAccessToken restricted_token; 363 ATL::CAccessToken restricted_token;
364 restricted_token.Attach(token_handle); 364 restricted_token.Attach(token_handle);
365 365
366 ATL::CTokenPrivileges privileges; 366 ATL::CTokenPrivileges privileges;
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 TEST(RestrictedTokenTest, DoubleInit) { 584 TEST(RestrictedTokenTest, DoubleInit) {
585 RestrictedToken token; 585 RestrictedToken token;
586 ASSERT_EQ(ERROR_SUCCESS, token.Init(NULL)); 586 ASSERT_EQ(ERROR_SUCCESS, token.Init(NULL));
587 587
588 ASSERT_EQ(ERROR_ALREADY_INITIALIZED, token.Init(NULL)); 588 ASSERT_EQ(ERROR_ALREADY_INITIALIZED, token.Init(NULL));
589 } 589 }
590 590
591 #endif 591 #endif
592 592
593 } // namespace sandbox 593 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/src/restricted_token.cc ('k') | sandbox/win/src/restricted_token_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698