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

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

Issue 937353002: Adding method to create process using LowBox token in sandbox code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to TOT to see if ios_dbg_simulator_ninja errors go away. Created 5 years, 9 months 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 | « sandbox/win/src/sandbox_policy_base.cc ('k') | sandbox/win/src/target_process.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "sandbox/win/src/sync_policy_test.h" 5 #include "sandbox/win/src/sync_policy_test.h"
6 6
7 #include "base/win/scoped_handle.h" 7 #include "base/win/scoped_handle.h"
8 #include "sandbox/win/src/sandbox.h" 8 #include "sandbox/win/src/sandbox.h"
9 #include "sandbox/win/src/sandbox_policy.h" 9 #include "sandbox/win/src/sandbox_policy.h"
10 #include "sandbox/win/src/sandbox_factory.h" 10 #include "sandbox/win/src/sandbox_factory.h"
(...skipping 11 matching lines...) Expand all
22 desired_access = EVENT_ALL_ACCESS; 22 desired_access = EVENT_ALL_ACCESS;
23 23
24 base::win::ScopedHandle event_open(::OpenEvent( 24 base::win::ScopedHandle event_open(::OpenEvent(
25 desired_access, FALSE, argv[1])); 25 desired_access, FALSE, argv[1]));
26 DWORD error_open = ::GetLastError(); 26 DWORD error_open = ::GetLastError();
27 27
28 if (event_open.IsValid()) 28 if (event_open.IsValid())
29 return SBOX_TEST_SUCCEEDED; 29 return SBOX_TEST_SUCCEEDED;
30 30
31 if (ERROR_ACCESS_DENIED == error_open || 31 if (ERROR_ACCESS_DENIED == error_open ||
32 ERROR_BAD_PATHNAME == error_open) 32 ERROR_BAD_PATHNAME == error_open ||
33 ERROR_FILE_NOT_FOUND == error_open)
33 return SBOX_TEST_DENIED; 34 return SBOX_TEST_DENIED;
34 35
35 return SBOX_TEST_FAILED; 36 return SBOX_TEST_FAILED;
36 } 37 }
37 38
38 SBOX_TESTS_COMMAND int Event_CreateOpen(int argc, wchar_t **argv) { 39 SBOX_TESTS_COMMAND int Event_CreateOpen(int argc, wchar_t **argv) {
39 if (argc < 2 || argc > 3) 40 if (argc < 2 || argc > 3)
40 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; 41 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND;
41 42
42 wchar_t *event_name = NULL; 43 wchar_t *event_name = NULL;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"Event_Open s test2")); 139 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"Event_Open s test2"));
139 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_Open f test3")); 140 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_Open f test3"));
140 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_Open s test4")); 141 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_Open s test4"));
141 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_CreateOpen f f test5")); 142 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_CreateOpen f f test5"));
142 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_CreateOpen t f test6")); 143 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_CreateOpen t f test6"));
143 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_CreateOpen f t test5")); 144 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_CreateOpen f t test5"));
144 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_CreateOpen t t test6")); 145 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"Event_CreateOpen t t test6"));
145 } 146 }
146 147
147 } // namespace sandbox 148 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/src/sandbox_policy_base.cc ('k') | sandbox/win/src/target_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698