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 #include "base/scoped_nsobject.h" | 5 #include "base/scoped_nsobject.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/browser/cocoa/browser_test_helper.h" | 7 #include "chrome/browser/cocoa/browser_test_helper.h" |
8 #include "chrome/browser/cocoa/cocoa_test_helper.h" | 8 #include "chrome/browser/cocoa/cocoa_test_helper.h" |
9 #include "chrome/browser/cocoa/notifications/balloon_controller.h" | 9 #include "chrome/browser/cocoa/notifications/balloon_controller.h" |
10 #include "chrome/browser/notifications/balloon.h" | 10 #include "chrome/browser/notifications/balloon.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 @end | 25 @end |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 // Use a dummy balloon collection for testing. | 29 // Use a dummy balloon collection for testing. |
30 class MockBalloonCollection : public BalloonCollection { | 30 class MockBalloonCollection : public BalloonCollection { |
31 virtual void Add(const Notification& notification, | 31 virtual void Add(const Notification& notification, |
32 Profile* profile) {} | 32 Profile* profile) {} |
33 virtual bool RemoveById(const std::string& id) { return false; } | 33 virtual bool RemoveById(const std::string& id) { return false; } |
34 virtual bool RemoveBySourceOrigin(const GURL& origin) { return false; } | 34 virtual bool RemoveBySourceOrigin(const GURL& origin) { return false; } |
| 35 virtual void RemoveAll() {} |
35 virtual bool HasSpace() const { return true; } | 36 virtual bool HasSpace() const { return true; } |
36 virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) {}; | 37 virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) {}; |
37 virtual void DisplayChanged() {} | 38 virtual void DisplayChanged() {} |
38 virtual void OnBalloonClosed(Balloon* source) {}; | 39 virtual void OnBalloonClosed(Balloon* source) {}; |
39 virtual const Balloons& GetActiveBalloons() { | 40 virtual const Balloons& GetActiveBalloons() { |
40 NOTREACHED(); | 41 NOTREACHED(); |
41 return balloons_; | 42 return balloons_; |
42 } | 43 } |
43 private: | 44 private: |
44 Balloons balloons_; | 45 Balloons balloons_; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 104 |
104 [controller showWindow:nil]; | 105 [controller showWindow:nil]; |
105 | 106 |
106 EXPECT_TRUE([controller desiredTotalWidth] > 100); | 107 EXPECT_TRUE([controller desiredTotalWidth] > 100); |
107 EXPECT_TRUE([controller desiredTotalHeight] > 100); | 108 EXPECT_TRUE([controller desiredTotalHeight] > 100); |
108 | 109 |
109 [controller closeBalloon:YES]; | 110 [controller closeBalloon:YES]; |
110 } | 111 } |
111 | 112 |
112 } | 113 } |
OLD | NEW |