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 #include "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/browser/notifications/balloon.h" | 7 #include "chrome/browser/notifications/balloon.h" |
8 #include "chrome/browser/notifications/balloon_collection.h" | 8 #include "chrome/browser/notifications/balloon_collection.h" |
9 #include "chrome/browser/notifications/notification.h" | 9 #include "chrome/browser/notifications/notification.h" |
10 #include "chrome/browser/notifications/notification_object_proxy.h" | 10 #include "chrome/browser/notifications/notification_object_proxy.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 @implementation TestBalloonController | 24 @implementation TestBalloonController |
25 - (void)initializeHost {} | 25 - (void)initializeHost {} |
26 @end | 26 @end |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 // Use a dummy balloon collection for testing. | 30 // Use a dummy balloon collection for testing. |
31 class MockBalloonCollection : public BalloonCollection { | 31 class MockBalloonCollection : public BalloonCollection { |
32 virtual void Add(const Notification& notification, | 32 virtual void Add(const Notification& notification, |
33 Profile* profile) OVERRIDE {} | 33 Profile* profile) OVERRIDE {} |
34 virtual bool DoesIdExist(const std::string& id) OVERRIDE { return false; } | 34 virtual const Notification* FindById(const std::string& id) const OVERRIDE { |
| 35 return NULL; |
| 36 } |
35 virtual bool RemoveById(const std::string& id) OVERRIDE { return false; } | 37 virtual bool RemoveById(const std::string& id) OVERRIDE { return false; } |
36 virtual bool RemoveBySourceOrigin(const GURL& origin) OVERRIDE { | 38 virtual bool RemoveBySourceOrigin(const GURL& origin) OVERRIDE { |
37 return false; | 39 return false; |
38 } | 40 } |
39 virtual bool RemoveByProfile(Profile* profile) OVERRIDE { return false; } | 41 virtual bool RemoveByProfile(Profile* profile) OVERRIDE { return false; } |
40 virtual void RemoveAll() OVERRIDE {} | 42 virtual void RemoveAll() OVERRIDE {} |
41 virtual bool HasSpace() const OVERRIDE { return true; } | 43 virtual bool HasSpace() const OVERRIDE { return true; } |
42 virtual void ResizeBalloon( | 44 virtual void ResizeBalloon( |
43 Balloon* balloon, | 45 Balloon* balloon, |
44 const gfx::Size& size) OVERRIDE { | 46 const gfx::Size& size) OVERRIDE { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 107 |
106 [controller showWindow:nil]; | 108 [controller showWindow:nil]; |
107 | 109 |
108 EXPECT_TRUE([controller desiredTotalWidth] > 100); | 110 EXPECT_TRUE([controller desiredTotalWidth] > 100); |
109 EXPECT_TRUE([controller desiredTotalHeight] > 100); | 111 EXPECT_TRUE([controller desiredTotalHeight] > 100); |
110 | 112 |
111 [controller closeBalloon:YES]; | 113 [controller closeBalloon:YES]; |
112 } | 114 } |
113 | 115 |
114 } | 116 } |
OLD | NEW |