Chromium Code Reviews| Index: sandbox/win/tests/integration_tests/integration_tests_common.h |
| diff --git a/sandbox/win/tests/integration_tests/integration_tests_common.h b/sandbox/win/tests/integration_tests/integration_tests_common.h |
| index 841e6e4b628d4164155be96bedcff3eb97e1f6b0..d59fc578605b0846f5cbbf051b4a0b4fc08b58f8 100644 |
| --- a/sandbox/win/tests/integration_tests/integration_tests_common.h |
| +++ b/sandbox/win/tests/integration_tests/integration_tests_common.h |
| @@ -7,37 +7,44 @@ |
| #include <windows.h> |
| -// Use the same header file for DLL and importers. |
| -#ifdef _DLL_EXPORTING |
| -#define DECLSPEC extern "C" __declspec(dllexport) |
| -#else |
| -#define DECLSPEC extern "C" __declspec(dllimport) |
| -#endif |
| +namespace sandbox { |
| //------------------------------------------------------------------------------ |
| -// Tests |
| +// Common - for sharing between source files. |
| //------------------------------------------------------------------------------ |
| -const wchar_t* g_extension_point_test_mutex = L"ChromeExtensionTestMutex"; |
| +enum TestPolicy { |
| + TESTPOLICY_DEP = 1, |
| + TESTPOLICY_ASLR, |
| + TESTPOLICY_STRICTHANDLE, |
| + TESTPOLICY_WIN32K, |
| + TESTPOLICY_EXTENSIONPOINT, |
| + TESTPOLICY_NONSYSFONT, |
| + TESTPOLICY_LOADNOREMOTE, |
| + TESTPOLICY_LOADNOLOW, |
| +}; |
| + |
| +// Timeout for ::WaitForSingleObject synchronization. |
| +DWORD SboxTestEventTimeout(); |
| //------------------------------------------------------------------------------ |
| -// Hooking WinProc exe. |
| +// Hooking WinProc exe - ExtensionPoint_Hook Tests. |
| //------------------------------------------------------------------------------ |
| -const wchar_t* g_winproc_file = L"sbox_integration_test_win_proc.exe "; |
| -const wchar_t* g_winproc_class_name = L"myWindowClass"; |
| -const wchar_t* g_winproc_window_name = L"ChromeMitigationTests"; |
| -const wchar_t* g_winproc_event = L"ChromeExtensionTestEvent"; |
| +const wchar_t g_winproc_file[] = L"sbox_integration_test_win_proc.exe "; |
| +const wchar_t g_winproc_class_name[] = L"myWindowClass"; |
| +const wchar_t g_winproc_window_name[] = L"ChromeMitigationTests"; |
| +const wchar_t g_winproc_event[] = L"ChromeExtensionTestEvent"; |
| //------------------------------------------------------------------------------ |
| -// Hooking dll. |
| +// Hooking dll - ExtensionPoint Tests. |
| //------------------------------------------------------------------------------ |
| -const wchar_t* g_hook_dll_file = L"sbox_integration_test_hook_dll.dll"; |
| -const wchar_t* g_hook_event = L"ChromeExtensionTestHookEvent"; |
| -const char* g_hook_handler_func = "HookProc"; |
| -const char* g_was_hook_called_func = "WasHookCalled"; |
| -const char* g_set_hook_func = "SetHook"; |
| - |
| -DECLSPEC LRESULT HookProc(int code, WPARAM wParam, LPARAM lParam); |
| -DECLSPEC bool WasHookCalled(); |
| -DECLSPEC void SetHook(HHOOK hook_handle); |
| +// Named mutex to acquire before touching any of these resources. |
| +extern const wchar_t g_extension_point_test_mutex[]; |
| +extern const wchar_t g_hook_dll_file[]; |
| +const wchar_t g_hook_event[] = L"ChromeExtensionTestHookEvent"; |
| +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
|
| +extern const char g_was_hook_called_func[]; |
| +extern const char g_set_hook_func[]; |
| + |
| +} // namespace sandbox |
| #endif // SANDBOX_TESTS_INTEGRATION_TESTS_COMMON_H_ |