Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "content/shell/renderer/shell_render_process_observer.h" | 5 #include "content/shell/renderer/shell_render_process_observer.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/public/common/content_client.h" | 8 #include "content/public/common/content_client.h" |
| 9 #include "content/public/renderer/render_thread.h" | 9 #include "content/public/renderer/render_thread.h" |
| 10 #include "content/public/renderer/render_view.h" | 10 #include "content/public/renderer/render_view.h" |
| 11 #include "content/public/test/layouttest_support.h" | 11 #include "content/public/test/layouttest_support.h" |
| 12 #include "content/shell/common/shell_messages.h" | 12 #include "content/shell/common/shell_messages.h" |
| 13 #include "content/shell/common/shell_switches.h" | 13 #include "content/shell/common/shell_switches.h" |
| 14 #include "content/shell/renderer/shell_content_renderer_client.h" | 14 #include "content/shell/renderer/shell_content_renderer_client.h" |
| 15 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | 15 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" |
| 16 #include "content/shell/renderer/webkit_test_runner.h" | 16 #include "content/shell/renderer/webkit_test_runner.h" |
| 17 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 17 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 18 #include "third_party/WebKit/public/web/WebView.h" | 18 #include "third_party/WebKit/public/web/WebView.h" |
| 19 #include "webkit/glue/webkit_glue.h" | |
| 20 | 19 |
| 21 using blink::WebFrame; | 20 using blink::WebFrame; |
| 22 using blink::WebRuntimeFeatures; | 21 using blink::WebRuntimeFeatures; |
| 23 using WebTestRunner::WebTestDelegate; | 22 using WebTestRunner::WebTestDelegate; |
| 24 using WebTestRunner::WebTestInterfaces; | 23 using WebTestRunner::WebTestInterfaces; |
| 25 | 24 |
| 26 namespace content { | 25 namespace content { |
| 27 | 26 |
| 28 namespace { | 27 namespace { |
| 29 ShellRenderProcessObserver* g_instance = NULL; | 28 ShellRenderProcessObserver* g_instance = NULL; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 58 void ShellRenderProcessObserver::SetMainWindow(RenderView* view) { | 57 void ShellRenderProcessObserver::SetMainWindow(RenderView* view) { |
| 59 WebKitTestRunner* test_runner = WebKitTestRunner::Get(view); | 58 WebKitTestRunner* test_runner = WebKitTestRunner::Get(view); |
| 60 test_interfaces_->setWebView(view->GetWebView(), test_runner->proxy()); | 59 test_interfaces_->setWebView(view->GetWebView(), test_runner->proxy()); |
| 61 main_test_runner_ = test_runner; | 60 main_test_runner_ = test_runner; |
| 62 } | 61 } |
| 63 | 62 |
| 64 void ShellRenderProcessObserver::WebKitInitialized() { | 63 void ShellRenderProcessObserver::WebKitInitialized() { |
| 65 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 64 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 66 return; | 65 return; |
| 67 | 66 |
| 68 // We always expose GC to layout tests. | |
| 69 webkit_glue::SetJavaScriptFlags(" --expose-gc"); | |
|
tfarina
2014/01/28 16:54:26
looks like removing this from here broke content_b
| |
| 70 | |
| 71 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 67 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 72 switches::kStableReleaseMode)) { | 68 switches::kStableReleaseMode)) { |
| 73 WebRuntimeFeatures::enableTestOnlyFeatures(true); | 69 WebRuntimeFeatures::enableTestOnlyFeatures(true); |
| 74 } | 70 } |
| 75 | 71 |
| 76 test_interfaces_.reset(new WebTestInterfaces); | 72 test_interfaces_.reset(new WebTestInterfaces); |
| 77 test_interfaces_->resetAll(); | 73 test_interfaces_->resetAll(); |
| 78 } | 74 } |
| 79 | 75 |
| 80 void ShellRenderProcessObserver::OnRenderProcessShutdown() { | 76 void ShellRenderProcessObserver::OnRenderProcessShutdown() { |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 91 | 87 |
| 92 return handled; | 88 return handled; |
| 93 } | 89 } |
| 94 | 90 |
| 95 void ShellRenderProcessObserver::OnSetWebKitSourceDir( | 91 void ShellRenderProcessObserver::OnSetWebKitSourceDir( |
| 96 const base::FilePath& webkit_source_dir) { | 92 const base::FilePath& webkit_source_dir) { |
| 97 webkit_source_dir_ = webkit_source_dir; | 93 webkit_source_dir_ = webkit_source_dir; |
| 98 } | 94 } |
| 99 | 95 |
| 100 } // namespace content | 96 } // namespace content |
| OLD | NEW |