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

Side by Side Diff: sandbox/win/tests/integration_tests/integration_tests_common.h

Issue 2944493002: [Windows Sandbox Tests] Process Mitigations. (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef SANDBOX_TESTS_INTEGRATION_TESTS_COMMON_H_ 5 #ifndef SANDBOX_TESTS_INTEGRATION_TESTS_COMMON_H_
6 #define SANDBOX_TESTS_INTEGRATION_TESTS_COMMON_H_ 6 #define SANDBOX_TESTS_INTEGRATION_TESTS_COMMON_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 9
10 // Use the same header file for DLL and importers. 10 namespace sandbox {
11 #ifdef _DLL_EXPORTING
12 #define DECLSPEC extern "C" __declspec(dllexport)
13 #else
14 #define DECLSPEC extern "C" __declspec(dllimport)
15 #endif
16 11
17 //------------------------------------------------------------------------------ 12 //------------------------------------------------------------------------------
18 // Tests 13 // Common - for sharing between source files.
19 //------------------------------------------------------------------------------ 14 //------------------------------------------------------------------------------
20 const wchar_t* g_extension_point_test_mutex = L"ChromeExtensionTestMutex"; 15 enum TestPolicy {
16 TESTPOLICY_DEP = 1,
17 TESTPOLICY_ASLR,
18 TESTPOLICY_STRICTHANDLE,
19 TESTPOLICY_WIN32K,
20 TESTPOLICY_EXTENSIONPOINT,
21 TESTPOLICY_NONSYSFONT,
22 TESTPOLICY_LOADNOREMOTE,
23 TESTPOLICY_LOADNOLOW,
24 };
25
26 // Timeout for ::WaitForSingleObject synchronization.
27 DWORD SboxTestEventTimeout();
21 28
22 //------------------------------------------------------------------------------ 29 //------------------------------------------------------------------------------
23 // Hooking WinProc exe. 30 // Hooking WinProc exe - ExtensionPoint_Hook Tests.
24 //------------------------------------------------------------------------------ 31 //------------------------------------------------------------------------------
25 const wchar_t* g_winproc_file = L"sbox_integration_test_win_proc.exe "; 32 const wchar_t g_winproc_file[] = L"sbox_integration_test_win_proc.exe ";
26 const wchar_t* g_winproc_class_name = L"myWindowClass"; 33 const wchar_t g_winproc_class_name[] = L"myWindowClass";
27 const wchar_t* g_winproc_window_name = L"ChromeMitigationTests"; 34 const wchar_t g_winproc_window_name[] = L"ChromeMitigationTests";
28 const wchar_t* g_winproc_event = L"ChromeExtensionTestEvent"; 35 const wchar_t g_winproc_event[] = L"ChromeExtensionTestEvent";
29 36
30 //------------------------------------------------------------------------------ 37 //------------------------------------------------------------------------------
31 // Hooking dll. 38 // Hooking dll - ExtensionPoint Tests.
32 //------------------------------------------------------------------------------ 39 //------------------------------------------------------------------------------
33 const wchar_t* g_hook_dll_file = L"sbox_integration_test_hook_dll.dll"; 40 // Named mutex to acquire before touching any of these resources.
34 const wchar_t* g_hook_event = L"ChromeExtensionTestHookEvent"; 41 extern const wchar_t g_extension_point_test_mutex[];
35 const char* g_hook_handler_func = "HookProc"; 42 extern const wchar_t g_hook_dll_file[];
36 const char* g_was_hook_called_func = "WasHookCalled"; 43 const wchar_t g_hook_event[] = L"ChromeExtensionTestHookEvent";
37 const char* g_set_hook_func = "SetHook"; 44 extern const char g_hook_handler_func[];
Will Harris 2017/06/15 22:32:13 not sure why these have to be extern const, what e
penny 2017/06/27 20:43:50 Some of the new tests coming up in CL2. But I've
45 extern const char g_was_hook_called_func[];
46 extern const char g_set_hook_func[];
38 47
39 DECLSPEC LRESULT HookProc(int code, WPARAM wParam, LPARAM lParam); 48 } // namespace sandbox
40 DECLSPEC bool WasHookCalled();
41 DECLSPEC void SetHook(HHOOK hook_handle);
42 49
43 #endif // SANDBOX_TESTS_INTEGRATION_TESTS_COMMON_H_ 50 #endif // SANDBOX_TESTS_INTEGRATION_TESTS_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698