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.
5 #include "ui/compositor/test/compositor_test_support.h"
7 #include "base/compiler_specific.h"
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
9 #include "webkit/glue/webkitplatformsupport_impl.h"
13 class CompositorTestPlatformSupport
:
14 public NON_EXPORTED_BASE(webkit_glue::WebKitPlatformSupportImpl
) {
16 virtual string16
GetLocalizedString(int message_id
) OVERRIDE
{
20 virtual base::StringPiece
GetDataResource(
22 ui::ScaleFactor scale_factor
) OVERRIDE
{
23 return base::StringPiece();
26 virtual void GetPlugins(
27 bool refresh
, std::vector
<webkit::WebPluginInfo
>* plugins
) OVERRIDE
{
30 virtual webkit_glue::ResourceLoaderBridge
* CreateResourceLoader(
31 const webkit_glue::ResourceLoaderBridge::RequestInfo
& request_info
)
37 virtual webkit_glue::WebSocketStreamHandleBridge
* CreateWebSocketBridge(
38 WebKit::WebSocketStreamHandle
* handle
,
39 webkit_glue::WebSocketStreamHandleDelegate
* delegate
) OVERRIDE
{
45 static CompositorTestPlatformSupport
* g_webkit_support
;
47 void CompositorTestSupport::Initialize() {
48 DCHECK(!g_webkit_support
);
49 g_webkit_support
= new CompositorTestPlatformSupport
;
50 WebKit::initialize(g_webkit_support
);
53 void CompositorTestSupport::Terminate() {
54 DCHECK(g_webkit_support
);
56 delete g_webkit_support
;
57 g_webkit_support
= NULL
;