| Index: chrome/browser/notifications/desktop_notifications_unittest.h
|
| diff --git a/chrome/browser/notifications/desktop_notifications_unittest.h b/chrome/browser/notifications/desktop_notifications_unittest.h
|
| index 935710fea1d8472965f1d528c0e0fde3ef158be4..86d45756584166d6c737ffd8b4ee6514d83dcfe1 100644
|
| --- a/chrome/browser/notifications/desktop_notifications_unittest.h
|
| +++ b/chrome/browser/notifications/desktop_notifications_unittest.h
|
| @@ -15,15 +15,23 @@
|
| #include "chrome/browser/notifications/desktop_notification_service.h"
|
| #include "chrome/browser/notifications/notification.h"
|
| #include "chrome/browser/notifications/notification_test_util.h"
|
| -#include "chrome/test/base/testing_profile.h"
|
| -#include "content/public/test/render_view_test.h"
|
| #include "content/public/test/test_browser_thread.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| +#include "ui/message_center/message_center_util.h"
|
| +
|
| +#if defined(USE_AURA)
|
| +#include "ui/aura/test/aura_test_helper.h"
|
| +#include "ui/views/test/desktop_test_views_delegate.h"
|
| +#endif
|
|
|
| class ActiveDesktopMonitor;
|
| class DesktopNotificationsTest;
|
| typedef LoggingNotificationDelegate<DesktopNotificationsTest>
|
| LoggingNotificationProxy;
|
| +class TestingProfileManager;
|
| +class TestingProfile;
|
| +
|
| +#if !defined(RUN_MESSAGE_CENTER_TESTS)
|
|
|
| // Test version of the balloon collection which counts the number
|
| // of notifications that are added to it.
|
| @@ -67,16 +75,16 @@ class MockBalloonCollection : public BalloonCollectionImpl {
|
| std::deque<Balloon*> balloons_;
|
| };
|
|
|
| +#endif // !defined(RUN_MESSAGE_CENTER_TESTS)
|
| +
|
| class DesktopNotificationsTest : public testing::Test {
|
| public:
|
| DesktopNotificationsTest();
|
| virtual ~DesktopNotificationsTest();
|
|
|
| - static void log(const std::string& message) {
|
| - log_output_.append(message);
|
| - }
|
| + static void log(const std::string& message);
|
|
|
| - Profile* profile() { return profile_.get(); }
|
| + TestingProfile* profile() { return profile_; }
|
|
|
| protected:
|
| // testing::Test overrides
|
| @@ -91,6 +99,8 @@ class DesktopNotificationsTest : public testing::Test {
|
| service_->DenyPermission(origin);
|
| }
|
|
|
| + int GetNotificationCount();
|
| +
|
| // Constructs a notification parameter structure for use in tests.
|
| content::ShowDesktopNotificationHostMsgParams StandardTestNotification();
|
|
|
| @@ -99,17 +109,28 @@ class DesktopNotificationsTest : public testing::Test {
|
| base::MessageLoopForUI message_loop_;
|
| content::TestBrowserThread ui_thread_;
|
|
|
| +#if defined(USE_AURA)
|
| + // Used to create the Aura environment for testing.
|
| + aura::test::AuraTestHelper aura_test_helper_;
|
| + views::DesktopTestViewsDelegate views_delegate_;
|
| +#endif
|
| +
|
| // Local state mock.
|
| TestingPrefServiceSimple local_state_;
|
|
|
| - // Test profile.
|
| - scoped_ptr<TestingProfile> profile_;
|
| + // Creator of profiles.
|
| + scoped_ptr<TestingProfileManager> profile_manager_;
|
| +
|
| + // Default profile created from profile_manager_.
|
| + TestingProfile* profile_;
|
|
|
| +#if !defined(RUN_MESSAGE_CENTER_TESTS)
|
| // Mock balloon collection -- owned by the NotificationUIManager
|
| MockBalloonCollection* balloon_collection_;
|
| +#endif
|
|
|
| // Real UI manager.
|
| - scoped_ptr<BalloonNotificationUIManager> ui_manager_;
|
| + scoped_ptr<NotificationUIManager> ui_manager_;
|
|
|
| // Real DesktopNotificationService
|
| scoped_ptr<DesktopNotificationService> service_;
|
|
|