OLD | NEW |
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 the validation tests for the sandbox. | 5 // This file contains the validation tests for the sandbox. |
6 // It includes the tests that need to be performed inside the | 6 // It includes the tests that need to be performed inside the |
7 // sandbox. | 7 // sandbox. |
8 | 8 |
9 #include <shlwapi.h> | 9 #include <shlwapi.h> |
10 | 10 |
11 #include "base/win/windows_version.h" | 11 #include "base/win/windows_version.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "sandbox/tests/common/controller.h" | 13 #include "sandbox/win/tests/common/controller.h" |
14 | 14 |
15 #pragma comment(lib, "shlwapi.lib") | 15 #pragma comment(lib, "shlwapi.lib") |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 void TestProcessAccess(sandbox::TestRunner* runner, DWORD target) { | 19 void TestProcessAccess(sandbox::TestRunner* runner, DWORD target) { |
20 const wchar_t *kCommandTemplate = L"OpenProcessCmd %d %d"; | 20 const wchar_t *kCommandTemplate = L"OpenProcessCmd %d %d"; |
21 wchar_t command[1024] = {0}; | 21 wchar_t command[1024] = {0}; |
22 | 22 |
23 // Test all the scary process permissions. | 23 // Test all the scary process permissions. |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // Tests if the threads are correctly protected by the sandbox. | 191 // Tests if the threads are correctly protected by the sandbox. |
192 TEST(ValidationSuite, TestThread) { | 192 TEST(ValidationSuite, TestThread) { |
193 TestRunner runner; | 193 TestRunner runner; |
194 wchar_t command[1024] = {0}; | 194 wchar_t command[1024] = {0}; |
195 | 195 |
196 wsprintf(command, L"OpenThreadCmd %d", ::GetCurrentThreadId()); | 196 wsprintf(command, L"OpenThreadCmd %d", ::GetCurrentThreadId()); |
197 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(command)); | 197 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(command)); |
198 } | 198 } |
199 | 199 |
200 } // namespace sandbox | 200 } // namespace sandbox |
OLD | NEW |