| 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 #include <stddef.h> |
| 10 | 11 |
| 11 #include "base/win/windows_version.h" | 12 #include "base/win/windows_version.h" |
| 13 #include "sandbox/win/tests/common/controller.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "sandbox/win/tests/common/controller.h" | |
| 14 | 15 |
| 15 #pragma comment(lib, "shlwapi.lib") | 16 #pragma comment(lib, "shlwapi.lib") |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 | 19 |
| 19 void TestProcessAccess(sandbox::TestRunner* runner, DWORD target) { | 20 void TestProcessAccess(sandbox::TestRunner* runner, DWORD target) { |
| 20 const wchar_t *kCommandTemplate = L"OpenProcessCmd %d %d"; | 21 const wchar_t *kCommandTemplate = L"OpenProcessCmd %d %d"; |
| 21 wchar_t command[1024] = {0}; | 22 wchar_t command[1024] = {0}; |
| 22 | 23 |
| 23 // Test all the scary process permissions. | 24 // Test all the scary process permissions. |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 TEST(ValidationSuite, TestMemoryNoLimit) { | 233 TEST(ValidationSuite, TestMemoryNoLimit) { |
| 233 TestRunner runner; | 234 TestRunner runner; |
| 234 wchar_t command[1024] = {0}; | 235 wchar_t command[1024] = {0}; |
| 235 const int kAllocationSize = 256 * 1024 * 1024; | 236 const int kAllocationSize = 256 * 1024 * 1024; |
| 236 | 237 |
| 237 wsprintf(command, L"AllocateCmd %d", kAllocationSize); | 238 wsprintf(command, L"AllocateCmd %d", kAllocationSize); |
| 238 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(command)); | 239 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(command)); |
| 239 } | 240 } |
| 240 | 241 |
| 241 } // namespace sandbox | 242 } // namespace sandbox |
| OLD | NEW |