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

Side by Side Diff: content/public/test/layouttest_support.h

Issue 584553002: Extend the TestRunner so that the manifest-src CSP directive can be tested from layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Passes upload hooks Created 6 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 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 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 CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ 5 #ifndef CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_
6 #define CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ 6 #define CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "cc/layers/texture_layer.h" 12 #include "cc/layers/texture_layer.h"
13 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h" 13 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
14 #include "url/gurl.h"
14 15
15 namespace blink { 16 namespace blink {
16 class WebBatteryStatus; 17 class WebBatteryStatus;
17 class WebDeviceMotionData; 18 class WebDeviceMotionData;
18 class WebDeviceOrientationData; 19 class WebDeviceOrientationData;
19 class WebGamepad; 20 class WebGamepad;
20 class WebGamepads; 21 class WebGamepads;
21 class WebLayer; 22 class WebLayer;
22 struct WebSize; 23 struct WebSize;
24 class WebView;
25 class WebURLResponse;
23 } 26 }
24 27
25 namespace content { 28 namespace content {
26 29
27 class PageState; 30 class PageState;
28 class RenderFrame; 31 class RenderFrame;
29 class RendererGamepadProvider; 32 class RendererGamepadProvider;
30 class RenderView; 33 class RenderView;
31 class WebTestProxyBase; 34 class WebTestProxyBase;
32 35
33 // Turn the browser process into layout test mode. 36 // Turn the browser process into layout test mode.
34 void EnableBrowserLayoutTestMode(); 37 void EnableBrowserLayoutTestMode();
35 38
36 /////////////////////////////////////////////////////////////////////////////// 39 ///////////////////////////////////////////////////////////////////////////////
37 // The following methods are meant to be used from a renderer. 40 // The following methods are meant to be used from a renderer.
38 41
39 // Turn a renderer into layout test mode. 42 // Turn a renderer into layout test mode.
40 void EnableRendererLayoutTestMode(); 43 void EnableRendererLayoutTestMode();
41 44
42 // Enable injecting of a WebTestProxy between WebViews and RenderViews. 45 // Enable injecting of a WebTestProxy between WebViews and RenderViews.
43 // |callback| is invoked with a pointer to WebTestProxyBase for each created 46 // |callback| is invoked with a pointer to WebTestProxyBase for each created
44 // WebTestProxy. 47 // WebTestProxy.
45 void EnableWebTestProxyCreation( 48 void EnableWebTestProxyCreation(
46 const base::Callback<void(RenderView*, WebTestProxyBase*)>& callback); 49 const base::Callback<void(RenderView*, WebTestProxyBase*)>& callback);
47 50
51 void FetchManifest(blink::WebView* view, GURL url,
52 base::Callback<void(const blink::WebURLResponse& response,
53 const std::string& data)> callback);
mlamouri (slow - plz ping) 2014/09/18 17:36:05 nit: I think it would be better to have a type for
54
48 // Sets gamepad provider to be used for layout tests. 55 // Sets gamepad provider to be used for layout tests.
49 void SetMockGamepadProvider(scoped_ptr<RendererGamepadProvider> provider); 56 void SetMockGamepadProvider(scoped_ptr<RendererGamepadProvider> provider);
50 57
51 // Sets a double that should be used when registering 58 // Sets a double that should be used when registering
52 // a listener through WebKitPlatformSupport::setDeviceLightListener(). 59 // a listener through WebKitPlatformSupport::setDeviceLightListener().
53 void SetMockDeviceLightData(const double data); 60 void SetMockDeviceLightData(const double data);
54 61
55 // Sets WebDeviceMotionData that should be used when registering 62 // Sets WebDeviceMotionData that should be used when registering
56 // a listener through WebKitPlatformSupport::setDeviceMotionListener(). 63 // a listener through WebKitPlatformSupport::setDeviceMotionListener().
57 void SetMockDeviceMotionData(const blink::WebDeviceMotionData& data); 64 void SetMockDeviceMotionData(const blink::WebDeviceMotionData& data);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // Provides a text dump of the contents of the given page state. 108 // Provides a text dump of the contents of the given page state.
102 std::string DumpBackForwardList(std::vector<PageState>& page_state, 109 std::string DumpBackForwardList(std::vector<PageState>& page_state,
103 size_t current_index); 110 size_t current_index);
104 111
105 // Instantiates WebLayerImpl for TestPlugin. 112 // Instantiates WebLayerImpl for TestPlugin.
106 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer); 113 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer);
107 114
108 } // namespace content 115 } // namespace content
109 116
110 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ 117 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_
OLDNEW
« no previous file with comments | « no previous file | content/shell/renderer/test_runner/test_runner.h » ('j') | content/shell/renderer/test_runner/test_runner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698