OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <string> | 10 #include <string> |
(...skipping 21 matching lines...) Expand all Loading... |
32 virtual ~MockBalloonCollection(); | 32 virtual ~MockBalloonCollection(); |
33 | 33 |
34 // Our mock collection has an area large enough for a fixed number | 34 // Our mock collection has an area large enough for a fixed number |
35 // of balloons. | 35 // of balloons. |
36 static const int kMockBalloonSpace; | 36 static const int kMockBalloonSpace; |
37 int max_balloon_count() const { return kMockBalloonSpace; } | 37 int max_balloon_count() const { return kMockBalloonSpace; } |
38 | 38 |
39 // BalloonCollectionImpl overrides | 39 // BalloonCollectionImpl overrides |
40 virtual void Add(const Notification& notification, | 40 virtual void Add(const Notification& notification, |
41 Profile* profile); | 41 Profile* profile); |
42 virtual bool HasSpace() const { return count() < kMockBalloonSpace; } | 42 virtual bool HasSpace() const; |
43 virtual Balloon* MakeBalloon(const Notification& notification, | 43 virtual Balloon* MakeBalloon(const Notification& notification, |
44 Profile* profile); | 44 Profile* profile); |
45 virtual void DisplayChanged() {} | 45 virtual void DisplayChanged() {} |
46 virtual void OnBalloonClosed(Balloon* source); | 46 virtual void OnBalloonClosed(Balloon* source); |
47 virtual const BalloonCollection::Balloons& GetActiveBalloons() { | 47 virtual const BalloonCollection::Balloons& GetActiveBalloons(); |
48 return balloons_; | |
49 } | |
50 | 48 |
51 // Number of balloons being shown. | 49 // Number of balloons being shown. |
52 std::deque<Balloon*>& balloons() { return balloons_; } | 50 std::deque<Balloon*>& balloons() { return balloons_; } |
53 int count() const { return balloons_.size(); } | 51 int count() const { return balloons_.size(); } |
54 | 52 |
55 // Returns the highest y-coordinate of all the balloons in the collection. | 53 // Returns the highest y-coordinate of all the balloons in the collection. |
56 int UppermostVerticalPosition(); | 54 int UppermostVerticalPosition(); |
57 | 55 |
58 // Returns the height bounds of a balloon. | 56 // Returns the height bounds of a balloon. |
59 int MinHeight() { return Layout::min_balloon_height(); } | 57 int MinHeight() { return Layout::min_balloon_height(); } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 scoped_ptr<NotificationUIManager> ui_manager_; | 112 scoped_ptr<NotificationUIManager> ui_manager_; |
115 | 113 |
116 // Real DesktopNotificationService | 114 // Real DesktopNotificationService |
117 scoped_ptr<DesktopNotificationService> service_; | 115 scoped_ptr<DesktopNotificationService> service_; |
118 | 116 |
119 // Contains the cumulative output of the unit test. | 117 // Contains the cumulative output of the unit test. |
120 static std::string log_output_; | 118 static std::string log_output_; |
121 }; | 119 }; |
122 | 120 |
123 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ | 121 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ |
OLD | NEW |