From c7283444a26c8f23dca69fb0d511b6309e7c91bb Mon Sep 17 00:00:00 2001 From: "mukai@chromium.org" Date: Tue, 1 Oct 2013 03:11:29 +0000 Subject: Cleanup: merge separate implementaions of ScreenshotDelegate for tests. BUG=None R=oshima@chromium.org TEST=ash_unittests Review URL: https://codereview.chromium.org/24257015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226118 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/test/ash_test_helper.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ash/test/ash_test_helper.cc') diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc index 28c652f..469504b 100644 --- a/ash/test/ash_test_helper.cc +++ b/ash/test/ash_test_helper.cc @@ -4,10 +4,12 @@ #include "ash/test/ash_test_helper.h" +#include "ash/accelerators/accelerator_controller.h" #include "ash/ash_switches.h" #include "ash/shell.h" #include "ash/test/display_manager_test_api.h" #include "ash/test/shell_test_api.h" +#include "ash/test/test_screenshot_delegate.h" #include "ash/test/test_session_state_delegate.h" #include "ash/test/test_shell_delegate.h" #include "ash/test/test_system_tray_delegate.h" @@ -33,6 +35,7 @@ namespace test { AshTestHelper::AshTestHelper(base::MessageLoopForUI* message_loop) : message_loop_(message_loop), test_shell_delegate_(NULL), + test_screenshot_delegate_(NULL), tear_down_network_handler_(false) { CHECK(message_loop_); #if defined(USE_X11) @@ -82,11 +85,16 @@ void AshTestHelper::SetUp(bool start_session) { test::DisplayManagerTestApi(shell->display_manager()). DisableChangeDisplayUponHostResize(); ShellTestApi(shell).DisableOutputConfiguratorAnimation(); + + test_screenshot_delegate_ = new TestScreenshotDelegate(); + shell->accelerator_controller()->SetScreenshotDelegate( + scoped_ptr(test_screenshot_delegate_)); } void AshTestHelper::TearDown() { // Tear down the shell. Shell::DeleteInstance(); + test_screenshot_delegate_ = NULL; // Remove global message center state. message_center::MessageCenter::Shutdown(); -- cgit v1.1