| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/support/webkit_support.h" | 5 #include "webkit/support/webkit_support.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug_util.h" | 9 #include "base/debug_util.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 106 } |
| 107 main_message_loop_.reset(new MessageLoopForUI); | 107 main_message_loop_.reset(new MessageLoopForUI); |
| 108 // TestWebKitClient must be instantiated after the MessageLoopForUI. | 108 // TestWebKitClient must be instantiated after the MessageLoopForUI. |
| 109 webkit_client_.reset(new TestWebKitClient(unit_test_mode)); | 109 webkit_client_.reset(new TestWebKitClient(unit_test_mode)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 ~TestEnvironment() { | 112 ~TestEnvironment() { |
| 113 SimpleResourceLoaderBridge::Shutdown(); | 113 SimpleResourceLoaderBridge::Shutdown(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 TestWebKitClient* webkit_client() { return webkit_client_.get(); } | 116 TestWebKitClient* webkit_client() const { return webkit_client_.get(); } |
| 117 | 117 |
| 118 #if defined(OS_WIN) | 118 #if defined(OS_WIN) |
| 119 void set_theme_engine(WebKit::WebThemeEngine* engine) { | 119 void set_theme_engine(WebKit::WebThemeEngine* engine) { |
| 120 DCHECK(webkit_client_ != 0); | 120 DCHECK(webkit_client_ != 0); |
| 121 webkit_client_->SetThemeEngine(engine); | 121 webkit_client_->SetThemeEngine(engine); |
| 122 } | 122 } |
| 123 | 123 |
| 124 WebKit::WebThemeEngine* theme_engine() { | 124 WebKit::WebThemeEngine* theme_engine() const { |
| 125 return webkit_client_->themeEngine(); | 125 return webkit_client_->themeEngine(); |
| 126 } | 126 } |
| 127 #endif | 127 #endif |
| 128 | 128 |
| 129 private: | 129 private: |
| 130 scoped_ptr<base::AtExitManager> at_exit_manager_; | 130 scoped_ptr<base::AtExitManager> at_exit_manager_; |
| 131 scoped_ptr<MessageLoopForUI> main_message_loop_; | 131 scoped_ptr<MessageLoopForUI> main_message_loop_; |
| 132 scoped_ptr<TestWebKitClient> webkit_client_; | 132 scoped_ptr<TestWebKitClient> webkit_client_; |
| 133 }; | 133 }; |
| 134 | 134 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // CommandLine::ForCurrentProcess(). We don't use the actual command-line | 174 // CommandLine::ForCurrentProcess(). We don't use the actual command-line |
| 175 // arguments of DRT to avoid unexpected behavior change. | 175 // arguments of DRT to avoid unexpected behavior change. |
| 176 // | 176 // |
| 177 // webkit/glue/webmediaplayer_impl.cc checks --enable-openmax. | 177 // webkit/glue/webmediaplayer_impl.cc checks --enable-openmax. |
| 178 // webkit/glue/plugin/plugin_list_posix.cc checks --debug-plugin-loading. | 178 // webkit/glue/plugin/plugin_list_posix.cc checks --debug-plugin-loading. |
| 179 // webkit/glue/plugin/plugin_list_win.cc checks --old-wmp. | 179 // webkit/glue/plugin/plugin_list_win.cc checks --old-wmp. |
| 180 // If DRT needs these flags, specify them in the following kFixedArguments. | 180 // If DRT needs these flags, specify them in the following kFixedArguments. |
| 181 const char* kFixedArguments[] = {"DumpRenderTree"}; | 181 const char* kFixedArguments[] = {"DumpRenderTree"}; |
| 182 CommandLine::Init(arraysize(kFixedArguments), kFixedArguments); | 182 CommandLine::Init(arraysize(kFixedArguments), kFixedArguments); |
| 183 | 183 |
| 184 webkit_support::BeforeInitialize(); | 184 webkit_support::BeforeInitialize(unit_test_mode); |
| 185 webkit_support::test_environment = new TestEnvironment(unit_test_mode); | 185 webkit_support::test_environment = new TestEnvironment(unit_test_mode); |
| 186 webkit_support::AfterInitialize(); | 186 webkit_support::AfterInitialize(unit_test_mode); |
| 187 if (!unit_test_mode) { | 187 if (!unit_test_mode) { |
| 188 // Load ICU data tables. This has to run after TestEnvironment is created | 188 // Load ICU data tables. This has to run after TestEnvironment is created |
| 189 // because on Linux, we need base::AtExitManager. | 189 // because on Linux, we need base::AtExitManager. |
| 190 icu_util::Initialize(); | 190 icu_util::Initialize(); |
| 191 } | 191 } |
| 192 } | 192 } |
| 193 | 193 |
| 194 void SetUpTestEnvironment(bool unit_test_mode) { | 194 void SetUpTestEnvironment(bool unit_test_mode) { |
| 195 SetUpTestEnvironment(); | 195 SetUpTestEnvironment(); |
| 196 } | 196 } |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 if (!webkit_glue::GetExeDirectory(&dirExe)) { | 492 if (!webkit_glue::GetExeDirectory(&dirExe)) { |
| 493 DCHECK(false); | 493 DCHECK(false); |
| 494 return WebURL(); | 494 return WebURL(); |
| 495 } | 495 } |
| 496 FilePath devToolsPath = dirExe.AppendASCII( | 496 FilePath devToolsPath = dirExe.AppendASCII( |
| 497 "resources/inspector/devtools.html"); | 497 "resources/inspector/devtools.html"); |
| 498 return net::FilePathToFileURL(devToolsPath); | 498 return net::FilePathToFileURL(devToolsPath); |
| 499 } | 499 } |
| 500 | 500 |
| 501 } // namespace webkit_support | 501 } // namespace webkit_support |
| OLD | NEW |