summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 20:35:57 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 20:35:57 +0000
commit4ccd3199c69cf97bbc11b334162eb5247f6a2306 (patch)
treea7bd62ee3e2ff60baa9cc84b26f8aae8497a4f5b /chrome
parent771ffd88b311312a0a643677e99d058d051797c9 (diff)
downloadchromium_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')
-rw-r--r--chrome/renderer/extensions/json_schema_unittest.cc25
-rw-r--r--chrome/test/render_view_test.cc8
2 files changed, 19 insertions, 14 deletions
diff --git a/chrome/renderer/extensions/json_schema_unittest.cc b/chrome/renderer/extensions/json_schema_unittest.cc
index cc7e2b9..ec6eaa2 100644
--- a/chrome/renderer/extensions/json_schema_unittest.cc
+++ b/chrome/renderer/extensions/json_schema_unittest.cc
@@ -48,49 +48,46 @@ class JsonSchemaTest : public V8UnitTest {
}
};
-// TODO: Re-enable this test! http://crbug.com/22971
-#if 0
-TEST_F(JsonSchemaTest, DISABLED_TestFormatError) {
+TEST_F(JsonSchemaTest, TestFormatError) {
TestFunction("testFormatError");
}
-TEST_F(JsonSchemaTest, DISABLED_TestComplex) {
+TEST_F(JsonSchemaTest, TestComplex) {
TestFunction("testComplex");
}
-TEST_F(JsonSchemaTest, DISABLED_TestEnum) {
+TEST_F(JsonSchemaTest, TestEnum) {
TestFunction("testEnum");
}
-TEST_F(JsonSchemaTest, DISABLED_TestExtends) {
+TEST_F(JsonSchemaTest, TestExtends) {
TestFunction("testExtends");
}
-TEST_F(JsonSchemaTest, DISABLED_TestObject) {
+TEST_F(JsonSchemaTest, TestObject) {
TestFunction("testObject");
}
-TEST_F(JsonSchemaTest, DISABLED_TestArrayTuple) {
+TEST_F(JsonSchemaTest, TestArrayTuple) {
TestFunction("testArrayTuple");
}
-TEST_F(JsonSchemaTest, DISABLED_TestArrayNonTuple) {
+TEST_F(JsonSchemaTest, TestArrayNonTuple) {
TestFunction("testArrayNonTuple");
}
-TEST_F(JsonSchemaTest, DISABLED_TestString) {
+TEST_F(JsonSchemaTest, TestString) {
TestFunction("testString");
}
-TEST_F(JsonSchemaTest, DISABLED_TestNumber) {
+TEST_F(JsonSchemaTest, TestNumber) {
TestFunction("testNumber");
}
-TEST_F(JsonSchemaTest, DISABLED_TestType) {
+TEST_F(JsonSchemaTest, TestType) {
TestFunction("testType");
}
-TEST_F(JsonSchemaTest, DISABLED_TestTypeReference) {
+TEST_F(JsonSchemaTest, TestTypeReference) {
TestFunction("testTypeReference");
}
-#endif
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.