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

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

Issue 10689170: Move the Windows sandbox to sandbox/win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on top of tree (properly this time) Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « sandbox/win/src/policy_target_test.cc ('k') | sandbox/win/src/process_thread_dispatcher.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) 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 #include <memory> 5 #include <memory>
6 #include <string> 6 #include <string>
7 7
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "base/win/scoped_handle.h" 9 #include "base/win/scoped_handle.h"
10 #include "base/win/scoped_process_information.h" 10 #include "base/win/scoped_process_information.h"
11 #include "sandbox/src/sandbox.h" 11 #include "sandbox/win/src/sandbox.h"
12 #include "sandbox/src/sandbox_policy.h" 12 #include "sandbox/win/src/sandbox_policy.h"
13 #include "sandbox/src/sandbox_factory.h" 13 #include "sandbox/win/src/sandbox_factory.h"
14 #include "sandbox/tests/common/controller.h" 14 #include "sandbox/win/tests/common/controller.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 namespace { 17 namespace {
18 18
19 // While the shell API provides better calls than this home brew function 19 // While the shell API provides better calls than this home brew function
20 // we use GetSystemWindowsDirectoryW which does not query the registry so 20 // we use GetSystemWindowsDirectoryW which does not query the registry so
21 // it is safe to use after revert. 21 // it is safe to use after revert.
22 std::wstring MakeFullPathToSystem32(const wchar_t* name) { 22 std::wstring MakeFullPathToSystem32(const wchar_t* name) {
23 wchar_t windows_path[MAX_PATH] = {0}; 23 wchar_t windows_path[MAX_PATH] = {0};
24 ::GetSystemWindowsDirectoryW(windows_path, MAX_PATH); 24 ::GetSystemWindowsDirectoryW(windows_path, MAX_PATH);
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 ASSERT_TRUE(!exe_path.empty()); 286 ASSERT_TRUE(!exe_path.empty());
287 EXPECT_TRUE(runner.AddRule(TargetPolicy::SUBSYS_PROCESS, 287 EXPECT_TRUE(runner.AddRule(TargetPolicy::SUBSYS_PROCESS,
288 TargetPolicy::PROCESS_ALL_EXEC, 288 TargetPolicy::PROCESS_ALL_EXEC,
289 exe_path.c_str())); 289 exe_path.c_str()));
290 290
291 EXPECT_EQ(SBOX_TEST_SUCCEEDED, 291 EXPECT_EQ(SBOX_TEST_SUCCEEDED,
292 runner.RunTest(L"Process_GetChildProcessToken findstr.exe")); 292 runner.RunTest(L"Process_GetChildProcessToken findstr.exe"));
293 } 293 }
294 294
295 } // namespace sandbox 295 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/src/policy_target_test.cc ('k') | sandbox/win/src/process_thread_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698