diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/public/test/render_view_test.cc | 12 | ||||
-rw-r--r-- | content/public/test/render_view_test.h | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc index c416114..5de488b 100644 --- a/content/public/test/render_view_test.cc +++ b/content/public/test/render_view_test.cc @@ -28,6 +28,10 @@ #include "ui/base/resource/resource_bundle.h" #include "v8/include/v8.h" +#if defined(OS_MACOSX) +#include "base/mac/scoped_nsautorelease_pool.h" +#endif + using blink::WebFrame; using blink::WebInputEvent; using blink::WebMouseEvent; @@ -143,6 +147,9 @@ void RenderViewTest::SetUp() { render_thread_->set_new_window_routing_id(kNewWindowRouteId); render_thread_->set_new_frame_routing_id(kNewFrameRouteId); +#if defined(OS_MACOSX) + autorelease_pool_.reset(new base::mac::ScopedNSAutoreleasePool()); +#endif command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); params_.reset(new MainFunctionParams(*command_line_)); platform_.reset(new RendererMainPlatformDelegate(*params_)); @@ -210,6 +217,11 @@ void RenderViewTest::TearDown() { // (http://crbug.com/21508). base::RunLoop().RunUntilIdle(); +#if defined(OS_MACOSX) + // Needs to run before blink::shutdown(). + autorelease_pool_.reset(NULL); +#endif + blink::shutdown(); platform_->PlatformUninitialize(); diff --git a/content/public/test/render_view_test.h b/content/public/test/render_view_test.h index 204d023..d0e9d0e 100644 --- a/content/public/test/render_view_test.h +++ b/content/public/test/render_view_test.h @@ -139,6 +139,10 @@ class RenderViewTest : public testing::Test { scoped_ptr<MainFunctionParams> params_; scoped_ptr<CommandLine> command_line_; +#if defined(OS_MACOSX) + scoped_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_; +#endif + private: void GoToOffset(int offset, const blink::WebHistoryItem& history_item); }; |