| OLD | NEW |
| 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #define TEST_INJECTION_DLL | 8 #define TEST_INJECTION_DLL |
| 9 #include "chrome/test/security_tests/ipc_security_tests.h" | 9 #include "chrome/test/security_tests/ipc_security_tests.h" |
| 10 #include "content/common/injection_test_dll.h" | 10 #include "content/common/injection_test_dll.h" |
| 11 #include "sandbox/tests/common/controller.h" | 11 #include "sandbox/win/tests/common/controller.h" |
| 12 #include "sandbox/tests/validation_tests/commands.h" | 12 #include "sandbox/win/tests/validation_tests/commands.h" |
| 13 | 13 |
| 14 using sandbox::TestOpenKey; | 14 using sandbox::TestOpenKey; |
| 15 using sandbox::TestOpenReadFile; | 15 using sandbox::TestOpenReadFile; |
| 16 using sandbox::TestOpenWriteFile; | 16 using sandbox::TestOpenWriteFile; |
| 17 | 17 |
| 18 #define SECURITY_CHECK(x) (*test_count)++; \ | 18 #define SECURITY_CHECK(x) (*test_count)++; \ |
| 19 if (sandbox::SBOX_TEST_DENIED != x) { \ | 19 if (sandbox::SBOX_TEST_DENIED != x) { \ |
| 20 return FALSE; \ | 20 return FALSE; \ |
| 21 }; | 21 }; |
| 22 | 22 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // number of tests executed, including the failing test. | 55 // number of tests executed, including the failing test. |
| 56 BOOL __declspec(dllexport) __cdecl RunPluginTests(int *test_count) { | 56 BOOL __declspec(dllexport) __cdecl RunPluginTests(int *test_count) { |
| 57 *test_count = 0; | 57 *test_count = 0; |
| 58 SECURITY_CHECK(TestOpenWriteFile(L"%SystemRoot%")); | 58 SECURITY_CHECK(TestOpenWriteFile(L"%SystemRoot%")); |
| 59 SECURITY_CHECK(TestOpenWriteFile(L"%ProgramFiles%")); | 59 SECURITY_CHECK(TestOpenWriteFile(L"%ProgramFiles%")); |
| 60 SECURITY_CHECK(TestOpenWriteFile(L"%SystemRoot%\\System32")); | 60 SECURITY_CHECK(TestOpenWriteFile(L"%SystemRoot%\\System32")); |
| 61 SECURITY_CHECK(TestOpenWriteFile(L"%SystemRoot%\\explorer.exe")); | 61 SECURITY_CHECK(TestOpenWriteFile(L"%SystemRoot%\\explorer.exe")); |
| 62 SECURITY_CHECK(TestOpenWriteFile(L"%SystemRoot%\\Cursors\\arrow_i.cur")); | 62 SECURITY_CHECK(TestOpenWriteFile(L"%SystemRoot%\\Cursors\\arrow_i.cur")); |
| 63 return TRUE; | 63 return TRUE; |
| 64 } | 64 } |
| OLD | NEW |