diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-25 20:35:57 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-25 20:35:57 +0000 |
commit | 4ccd3199c69cf97bbc11b334162eb5247f6a2306 (patch) | |
tree | a7bd62ee3e2ff60baa9cc84b26f8aae8497a4f5b /chrome/test/render_view_test.cc | |
parent | 771ffd88b311312a0a643677e99d058d051797c9 (diff) | |
download | chromium_src-4ccd3199c69cf97bbc11b334162eb5247f6a2306.zip chromium_src-4ccd3199c69cf97bbc11b334162eb5247f6a2306.tar.gz chromium_src-4ccd3199c69cf97bbc11b334162eb5247f6a2306.tar.bz2 |
Force garbage collection after running any unit tests that initialize WebViews.
It's quite possible that we just plain shouldn't allow any unit tests to
initialize WebKit for philosophical and theoretical reasons. But this does
seem to work, so I guess we should just go this route for now.
BUG=22971
TEST=none
Review URL: http://codereview.chromium.org/240001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27239 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/render_view_test.cc')
-rw-r--r-- | chrome/test/render_view_test.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/test/render_view_test.cc b/chrome/test/render_view_test.cc index 46805e1..551eb17 100644 --- a/chrome/test/render_view_test.cc +++ b/chrome/test/render_view_test.cc @@ -20,6 +20,7 @@ #include "webkit/api/public/WebScriptSource.h" #include "webkit/api/public/WebURLRequest.h" #include "webkit/glue/webview.h" +#include "webkit/glue/webkit_glue.h" using WebKit::WebFrame; using WebKit::WebScriptSource; @@ -68,6 +69,9 @@ void RenderViewTest::SetUp() { platform_.reset(new RendererMainPlatformDelegate(*params_)); platform_->PlatformInitialize(); + // Setting flags and really doing anything with WebKit is fairly fragile and + // hacky, but this is the world we live in... + webkit_glue::SetJavaScriptFlags(L" --expose-gc"); WebKit::initialize(&webkitclient_); WebKit::registerExtension(BaseJsV8Extension::Get()); WebKit::registerExtension(JsonSchemaJsV8Extension::Get()); @@ -100,6 +104,10 @@ void RenderViewTest::SetUp() { mock_keyboard_.reset(new MockKeyboard()); } void RenderViewTest::TearDown() { + // Try very hard to collect garbage before shutting down. + GetMainFrame()->collectGarbage(); + GetMainFrame()->collectGarbage(); + render_thread_.SendCloseMessage(); // Run the loop so the release task from the renderwidget executes. |