| 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 12 matching lines...) Expand all Loading... |
| 23 @implementation TestBalloonController | 23 @implementation TestBalloonController |
| 24 - (void)initializeHost {} | 24 - (void)initializeHost {} |
| 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 Remove(const Notification& notification) { return false; } | 33 virtual bool RemoveById(const std::string& id) { return false; } |
| 34 virtual bool RemoveBySourceOrigin(const GURL& origin) { return false; } |
| 34 virtual bool HasSpace() const { return true; } | 35 virtual bool HasSpace() const { return true; } |
| 35 virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) {}; | 36 virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) {}; |
| 36 virtual void DisplayChanged() {} | 37 virtual void DisplayChanged() {} |
| 37 virtual void OnBalloonClosed(Balloon* source) {}; | 38 virtual void OnBalloonClosed(Balloon* source) {}; |
| 38 virtual const Balloons& GetActiveBalloons() { | 39 virtual const Balloons& GetActiveBalloons() { |
| 39 NOTREACHED(); | 40 NOTREACHED(); |
| 40 return balloons_; | 41 return balloons_; |
| 41 } | 42 } |
| 42 private: | 43 private: |
| 43 Balloons balloons_; | 44 Balloons balloons_; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 103 |
| 103 [controller showWindow:nil]; | 104 [controller showWindow:nil]; |
| 104 | 105 |
| 105 EXPECT_TRUE([controller desiredTotalWidth] > 100); | 106 EXPECT_TRUE([controller desiredTotalWidth] > 100); |
| 106 EXPECT_TRUE([controller desiredTotalHeight] > 100); | 107 EXPECT_TRUE([controller desiredTotalHeight] > 100); |
| 107 | 108 |
| 108 [controller closeBalloon:YES]; | 109 [controller closeBalloon:YES]; |
| 109 } | 110 } |
| 110 | 111 |
| 111 } | 112 } |
| OLD | NEW |