summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/desktop_notifications_unittest.cc
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-22 01:03:36 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-22 01:03:36 +0000
commitbd413eeae7e88c9abd16f3002e879231131b0bca (patch)
tree8db2fd2faf3486ba391c22ae5a31f1ccebc066ee /chrome/browser/notifications/desktop_notifications_unittest.cc
parent1bea45ecc5fec1ff6e3c7b659480e05e373afd9b (diff)
downloadchromium_src-bd413eeae7e88c9abd16f3002e879231131b0bca.zip
chromium_src-bd413eeae7e88c9abd16f3002e879231131b0bca.tar.gz
chromium_src-bd413eeae7e88c9abd16f3002e879231131b0bca.tar.bz2
desktop notification test setup: valid ShellDelegate, create ActiveDesktopMonitor
Two fixes for DesktopNotificationTest.* on win_aura: - was creating a ShellInstance with a NULL delegate which Shell DCHECKs on: pull in ash::test::TestShellDelegate - wasn't creating an ActiveDesktopMonitor, so instantiate one for test purposes. Also, change a couple USE_AURAs that look like they should be USE_ASHs. R=grt@chromium.org, stevenjb@chromium.org TEST=browser_tests on win_aura, DesktopNotificationTest.* Review URL: https://chromiumcodereview.appspot.com/11416145 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications/desktop_notifications_unittest.cc')
-rw-r--r--chrome/browser/notifications/desktop_notifications_unittest.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/notifications/desktop_notifications_unittest.cc b/chrome/browser/notifications/desktop_notifications_unittest.cc
index 4a96e9f..6e5c308 100644
--- a/chrome/browser/notifications/desktop_notifications_unittest.cc
+++ b/chrome/browser/notifications/desktop_notifications_unittest.cc
@@ -12,8 +12,10 @@
#include "chrome/test/base/testing_pref_service.h"
#include "content/public/common/show_desktop_notification_params.h"
-#if defined(USE_AURA)
+#if defined(USE_ASH)
#include "ash/shell.h"
+#include "ash/test/test_shell_delegate.h"
+#include "chrome/browser/ui/aura/active_desktop_monitor.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
#include "ui/aura/env.h"
#include "ui/aura/root_window.h"
@@ -96,7 +98,8 @@ void DesktopNotificationsTest::SetUp() {
WebKit::initialize(webkit_platform_support_.Get());
// MockBalloonCollection retrieves information about the screen on creation.
// So it is necessary to make sure the desktop gets created first.
- ash::Shell::CreateInstance(NULL);
+ ash::Shell::CreateInstance(new ash::test::TestShellDelegate);
+ active_desktop_monitor_.reset(new ActiveDesktopMonitor);
#endif
chrome::RegisterLocalState(&local_state_);
@@ -113,6 +116,7 @@ void DesktopNotificationsTest::TearDown() {
ui_manager_.reset(NULL);
profile_.reset(NULL);
#if defined(USE_ASH)
+ active_desktop_monitor_.reset();
ash::Shell::DeleteInstance();
aura::Env::DeleteInstance();
WebKit::shutdown();