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

Side by Side Diff: content/test/content_layouttest_support.cc

Issue 11362161: Use the WebTestProxy for layout tests in content_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: version that doesn't expose RenderViewImpl in public API Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
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 #include "content/public/test/content_layouttest_support.h"
6
7 #include "base/callback.h"
8 #include "base/lazy_instance.h"
9 #include "content/renderer/render_view_impl.h"
10 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web TestProxy.h"
11
12 using WebTestRunner::WebTestProxy;
13 using WebTestRunner::WebTestProxyBase;
14
15 namespace content {
16
17 namespace {
18
19 base::LazyInstance<base::Callback<void(WebTestProxyBase*)> >::Leaky g_callback;
20
21 RenderViewImpl* CreateWebTestProxy(RenderViewImplParams* params) {
22 typedef WebTestProxy<RenderViewImpl, RenderViewImplParams*> ProxyType;
23 ProxyType* render_view_proxy = new ProxyType(
24 reinterpret_cast<RenderViewImplParams*>(params));
jam 2012/11/08 20:37:06 nit: no cast needed
25 if (g_callback == 0)
26 return render_view_proxy;
27 g_callback.Get().Run(static_cast<WebTestProxyBase*>(render_view_proxy));
28 return render_view_proxy;
29 }
30
31 } // namespace
32
33
34 void EnableWebTestProxyCreation(
35 const base::Callback<void(WebTestProxyBase*)>& callback) {
36 g_callback.Get() = callback;
37 RenderViewImpl::InstallCreateHook(CreateWebTestProxy);
38 }
39
40 } // namespace content
OLDNEW
« content/shell/shell_render_process_observer.h ('K') | « content/test/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698