| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/prefs/testing_pref_service.h" | 12 #include "base/prefs/testing_pref_service.h" |
| 13 #include "chrome/browser/notifications/balloon_collection_impl.h" | 13 #include "chrome/browser/notifications/balloon_collection_impl.h" |
| 14 #include "chrome/browser/notifications/balloon_notification_ui_manager.h" | 14 #include "chrome/browser/notifications/balloon_notification_ui_manager.h" |
| 15 #include "chrome/browser/notifications/desktop_notification_service.h" | 15 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 16 #include "chrome/browser/notifications/notification.h" | 16 #include "chrome/browser/notifications/notification.h" |
| 17 #include "chrome/browser/notifications/notification_test_util.h" | 17 #include "chrome/browser/notifications/notification_test_util.h" |
| 18 #include "chrome/test/base/testing_browser_process.h" | 18 #include "chrome/test/base/testing_browser_process.h" |
| 19 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
| 20 #include "content/public/test/render_view_test.h" | 20 #include "content/public/test/render_view_test.h" |
| 21 #include "content/public/test/test_browser_thread.h" | 21 #include "content/public/test/test_browser_thread.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 | 23 |
| 24 #if defined(USE_AURA) |
| 25 namespace views { |
| 26 namespace corewm { |
| 27 class WMState; |
| 28 } |
| 29 } |
| 30 #endif |
| 31 |
| 24 class ActiveDesktopMonitor; | 32 class ActiveDesktopMonitor; |
| 25 class DesktopNotificationsTest; | 33 class DesktopNotificationsTest; |
| 26 typedef LoggingNotificationDelegate<DesktopNotificationsTest> | 34 typedef LoggingNotificationDelegate<DesktopNotificationsTest> |
| 27 LoggingNotificationProxy; | 35 LoggingNotificationProxy; |
| 28 | 36 |
| 29 // Test version of the balloon collection which counts the number | 37 // Test version of the balloon collection which counts the number |
| 30 // of notifications that are added to it. | 38 // of notifications that are added to it. |
| 31 class MockBalloonCollection : public BalloonCollectionImpl { | 39 class MockBalloonCollection : public BalloonCollectionImpl { |
| 32 public: | 40 public: |
| 33 MockBalloonCollection(); | 41 MockBalloonCollection(); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 MockBalloonCollection* balloon_collection_; | 122 MockBalloonCollection* balloon_collection_; |
| 115 | 123 |
| 116 // Real UI manager. | 124 // Real UI manager. |
| 117 scoped_ptr<BalloonNotificationUIManager> ui_manager_; | 125 scoped_ptr<BalloonNotificationUIManager> ui_manager_; |
| 118 | 126 |
| 119 // Real DesktopNotificationService | 127 // Real DesktopNotificationService |
| 120 scoped_ptr<DesktopNotificationService> service_; | 128 scoped_ptr<DesktopNotificationService> service_; |
| 121 | 129 |
| 122 // Contains the cumulative output of the unit test. | 130 // Contains the cumulative output of the unit test. |
| 123 static std::string log_output_; | 131 static std::string log_output_; |
| 132 |
| 133 private: |
| 134 #if defined(USE_AURA) |
| 135 scoped_ptr<views::corewm::WMState> wm_state_; |
| 136 #endif |
| 137 |
| 138 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationsTest); |
| 124 }; | 139 }; |
| 125 | 140 |
| 126 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ | 141 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ |
| OLD | NEW |