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 3 // found in the LICENSE file. 4 5 // Multiply-included file, no traditional include guard. 6 #include <string> 7 #include <vector> 8 9 #include "content/public/common/common_param_traits.h" 10 #include "content/public/common/page_state.h" 11 #include "content/shell/common/shell_test_configuration.h" 12 #include "ipc/ipc_message_macros.h" 13 #include "ipc/ipc_platform_file.h" 14 #include "third_party/skia/include/core/SkBitmap.h" 15 16 #define IPC_MESSAGE_START ShellMsgStart 17 18 IPC_STRUCT_TRAITS_BEGIN(content::ShellTestConfiguration) 19 IPC_STRUCT_TRAITS_MEMBER(current_working_directory) 20 IPC_STRUCT_TRAITS_MEMBER(temp_path) 21 IPC_STRUCT_TRAITS_MEMBER(test_url) 22 IPC_STRUCT_TRAITS_MEMBER(enable_pixel_dumping) 23 IPC_STRUCT_TRAITS_MEMBER(allow_external_pages) 24 IPC_STRUCT_TRAITS_MEMBER(expected_pixel_hash) 25 IPC_STRUCT_TRAITS_MEMBER(initial_size) 26 IPC_STRUCT_TRAITS_END() 27 28 // Tells the renderer to reset all test runners. 29 IPC_MESSAGE_ROUTED0(ShellViewMsg_Reset) 30 31 // Sets the path to the WebKit checkout. 32 IPC_MESSAGE_CONTROL1(ShellViewMsg_SetWebKitSourceDir, 33 base::FilePath /* webkit source dir */) 34 35 // Sets the initial configuration to use for layout tests. 36 IPC_MESSAGE_ROUTED1(ShellViewMsg_SetTestConfiguration, 37 content::ShellTestConfiguration) 38 39 // Tells the main window that a secondary window in a different process invoked 40 // notifyDone(). 41 IPC_MESSAGE_ROUTED0(ShellViewMsg_NotifyDone) 42 43 // Pushes a snapshot of the current session history from the browser process. 44 // This includes only information about those RenderViews that are in the 45 // same process as the main window of the layout test and that are the current 46 // active RenderView of their WebContents. 47 IPC_MESSAGE_ROUTED3( 48 ShellViewMsg_SessionHistory, 49 std::vector<int> /* routing_ids */, 50 std::vector<std::vector<content::PageState> > /* session_histories */, 51 std::vector<unsigned> /* current_entry_indexes */) 52 53 // Send a text dump of the WebContents to the render host. 54 IPC_MESSAGE_ROUTED1(ShellViewHostMsg_TextDump, 55 std::string /* dump */) 56 57 // Send an image dump of the WebContents to the render host. 58 IPC_MESSAGE_ROUTED2(ShellViewHostMsg_ImageDump, 59 std::string /* actual pixel hash */, 60 SkBitmap /* image */) 61 62 // Send an audio dump to the render host. 63 IPC_MESSAGE_ROUTED1(ShellViewHostMsg_AudioDump, 64 std::vector<unsigned char> /* audio data */) 65 66 IPC_MESSAGE_ROUTED0(ShellViewHostMsg_TestFinished) 67 68 IPC_MESSAGE_ROUTED0(ShellViewHostMsg_ResetDone) 69 70 IPC_MESSAGE_ROUTED0(ShellViewHostMsg_TestFinishedInSecondaryWindow) 71 72 // WebTestDelegate related. 73 IPC_MESSAGE_ROUTED1(ShellViewHostMsg_OverridePreferences, 74 WebPreferences /* preferences */) 75 IPC_SYNC_MESSAGE_ROUTED1_1(ShellViewHostMsg_RegisterIsolatedFileSystem, 76 std::vector<base::FilePath> /* absolute_filenames */, 77 std::string /* filesystem_id */) 78 IPC_SYNC_MESSAGE_ROUTED1_1(ShellViewHostMsg_ReadFileToString, 79 base::FilePath /* local path */, 80 std::string /* contents */) 81 IPC_MESSAGE_ROUTED1(ShellViewHostMsg_PrintMessage, 82 std::string /* message */) 83 IPC_MESSAGE_ROUTED0(ShellViewHostMsg_ShowDevTools) 84 IPC_MESSAGE_ROUTED0(ShellViewHostMsg_CloseDevTools) 85 IPC_MESSAGE_ROUTED1(ShellViewHostMsg_GoToOffset, 86 int /* offset */) 87 IPC_MESSAGE_ROUTED0(ShellViewHostMsg_Reload) 88 IPC_MESSAGE_ROUTED2(ShellViewHostMsg_LoadURLForFrame, 89 GURL /* url */, 90 std::string /* frame_name */) 91 IPC_MESSAGE_ROUTED0(ShellViewHostMsg_ClearAllDatabases) 92 IPC_MESSAGE_ROUTED1(ShellViewHostMsg_SetDatabaseQuota, 93 int /* quota */) 94 IPC_MESSAGE_ROUTED1(ShellViewHostMsg_AcceptAllCookies, 95 bool /* accept */) 96 IPC_MESSAGE_ROUTED0(ShellViewHostMsg_DeleteAllCookies) 97 IPC_MESSAGE_ROUTED1(ShellViewHostMsg_SetDeviceScaleFactor, 98 float /* factor */) 99 IPC_MESSAGE_ROUTED0(ShellViewHostMsg_CaptureSessionHistory) 100 IPC_MESSAGE_ROUTED0(ShellViewHostMsg_CloseRemainingWindows) 101