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 "content/shell/shell_render_process_observer.h"
7 #include "base/command_line.h"
8 #include "content/public/renderer/render_thread.h"
9 #include "content/shell/shell_switches.h"
10 #include "content/shell/webkit_test_runner_bindings.h"
11 #include "webkit/glue/webkit_glue.h"
12 #include "webkit/support/gc_extension.h"
16 ShellRenderProcessObserver::ShellRenderProcessObserver() {
17 RenderThread::Get()->AddObserver(this);
20 ShellRenderProcessObserver::~ShellRenderProcessObserver() {
23 void ShellRenderProcessObserver::WebKitInitialized() {
24 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree
))
27 // To implement a catch-all for not yet implemented controller properties.
28 webkit_glue::SetJavaScriptFlags(" --harmony_proxies");
29 RenderThread::Get()->RegisterExtension(new WebKitTestRunnerBindings());
31 // We always expose GC to layout tests.
32 webkit_glue::SetJavaScriptFlags(" --expose-gc");
33 RenderThread::Get()->RegisterExtension(extensions_v8::GCExtension::Get());
36 } // namespace content