layouttest_support.h revision b2df76ea8fec9e32f6f3718986dba0d95315b29c
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#ifndef CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ 6#define CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ 7 8#include "base/callback_forward.h" 9 10namespace WebKit { 11class WebGamepads; 12struct WebSize; 13} 14 15namespace WebTestRunner { 16class WebTestProxyBase; 17} 18 19namespace content { 20 21class RenderView; 22 23// Enable injecting of a WebTestProxy between WebViews and RenderViews. 24// |callback| is invoked with a pointer to WebTestProxyBase for each created 25// WebTestProxy. 26void EnableWebTestProxyCreation(const base::Callback< 27 void(RenderView*, WebTestRunner::WebTestProxyBase*)>& callback); 28 29// Sets the WebGamepads that should be returned by 30// WebKitPlatformSupport::sampleGamepads(). 31void SetMockGamepads(const WebKit::WebGamepads& pads); 32 33// Disable logging to the console from the appcache system. 34void DisableAppCacheLogging(); 35 36// Enable testing support in the devtools client. 37void EnableDevToolsFrontendTesting(); 38 39// Returns the length of the local session history of a render view. 40int GetLocalSessionHistoryLength(RenderView* render_view); 41 42void SetAllowOSMesaImageTransportForTesting(); 43 44// Suppress sending focus events from the renderer to the browser. 45void DoNotSendFocusEvents(); 46 47// Sync the current session history to the browser process. 48void SyncNavigationState(RenderView* render_view); 49 50// Sets the focus of the render view depending on |enable|. This only overrides 51// the state of the renderer, and does not sync the focus to the browser 52// process. 53void SetFocusAndActivate(RenderView* render_view, bool enable); 54 55// When WebKit requests a size change, immediately report the new sizes back to 56// WebKit instead of waiting for the browser to acknowledge the new size. 57void EnableShortCircuitSizeUpdates(); 58 59// Changes the window rect of the given render view. 60void ForceResizeRenderView(RenderView* render_view, 61 const WebKit::WebSize& new_size); 62 63// Never display error pages when a navigation fails. 64void DisableNavigationErrorPages(); 65 66// Set the device scale factor and force the compositor to resize. 67void SetDeviceScaleFactor(RenderView* render_view, float factor); 68 69// Disable system calls related to drag & drop. 70void DisableSystemDragDrop(); 71 72// Don't show modal popup menus. 73void DisableModalPopupMenus(); 74 75} // namespace content 76 77#endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ 78