summaryrefslogtreecommitdiffstats
path: root/chrome/test/render_view_test.cc
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-18 17:28:38 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-18 17:28:38 +0000
commit9a514902f55117eae04a60f917905e33e9914d32 (patch)
tree1542d8584e2627c9cb6d22edfe8479577dee79e1 /chrome/test/render_view_test.cc
parent50ca28cf1390710a23342e8a3ec273da9dc61007 (diff)
downloadchromium_src-9a514902f55117eae04a60f917905e33e9914d32.zip
chromium_src-9a514902f55117eae04a60f917905e33e9914d32.tar.gz
chromium_src-9a514902f55117eae04a60f917905e33e9914d32.tar.bz2
Mac: Initialize webkit system so that render_view_unittest.cc can run.
Basically the same fix as http://codereview.chromium.org/21330 . Still no good idea on how to make that more general without being arbitrary. Review URL: http://codereview.chromium.org/113425 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16295 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/render_view_test.cc')
-rw-r--r--chrome/test/render_view_test.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/test/render_view_test.cc b/chrome/test/render_view_test.cc
index 4096238..7eff1f9 100644
--- a/chrome/test/render_view_test.cc
+++ b/chrome/test/render_view_test.cc
@@ -11,6 +11,7 @@
#include "chrome/renderer/extensions/extension_process_bindings.h"
#include "chrome/renderer/extensions/renderer_extension_bindings.h"
#include "chrome/renderer/js_only_v8_extensions.h"
+#include "chrome/renderer/renderer_main_platform_delegate.h"
#include "webkit/api/public/WebInputEvent.h"
#include "webkit/api/public/WebKit.h"
#include "webkit/api/public/WebScriptSource.h"
@@ -54,6 +55,17 @@ void RenderViewTest::LoadHTML(const char* html) {
}
void RenderViewTest::SetUp() {
+ sandbox_init_wrapper_.reset(new SandboxInitWrapper());
+#if defined(OS_WIN)
+ command_line_.reset(new CommandLine(std::wstring()));
+#elif defined(OS_POSIX)
+ command_line_.reset(new CommandLine(std::vector<std::string>()));
+#endif
+ params_.reset(new MainFunctionParams(*command_line_, *sandbox_init_wrapper_,
+ NULL));
+ platform_.reset(new RendererMainPlatformDelegate(*params_));
+ platform_->PlatformInitialize();
+
WebKit::initialize(&webkitclient_);
WebKit::registerExtension(BaseJsV8Extension::Get());
WebKit::registerExtension(JsonJsV8Extension::Get());
@@ -96,6 +108,12 @@ void RenderViewTest::TearDown() {
msg_loop_.RunAllPending();
mock_keyboard_.reset();
+
+ platform_->PlatformUninitialize();
+ platform_.reset();
+ params_.reset();
+ command_line_.reset();
+ sandbox_init_wrapper_.reset();
}
int RenderViewTest::SendKeyEvent(MockKeyboard::Layout layout,