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 "chrome/browser/cocoa/browser_test_helper.h" | 6 #include "chrome/browser/cocoa/browser_test_helper.h" |
7 #include "chrome/browser/cocoa/cocoa_test_helper.h" | 7 #include "chrome/browser/cocoa/cocoa_test_helper.h" |
8 #include "chrome/browser/cocoa/notifications/balloon_controller.h" | 8 #include "chrome/browser/cocoa/notifications/balloon_controller.h" |
9 #include "chrome/browser/notifications/balloon.h" | 9 #include "chrome/browser/notifications/balloon.h" |
10 #include "chrome/browser/notifications/balloon_collection.h" | 10 #include "chrome/browser/notifications/balloon_collection.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 BalloonController* controller = [BalloonController alloc]; | 71 BalloonController* controller = [BalloonController alloc]; |
72 | 72 |
73 id mock = [OCMockObject partialMockForObject:controller]; | 73 id mock = [OCMockObject partialMockForObject:controller]; |
74 [[mock expect] initializeHost]; | 74 [[mock expect] initializeHost]; |
75 | 75 |
76 [controller initWithBalloon:balloon.get()]; | 76 [controller initWithBalloon:balloon.get()]; |
77 [controller showWindow:nil]; | 77 [controller showWindow:nil]; |
78 [controller closeBalloon:YES]; | 78 [controller closeBalloon:YES]; |
79 | 79 |
80 [mock verify]; | 80 [mock verify]; |
| 81 [controller release]; |
81 } | 82 } |
82 | 83 |
83 TEST_F(BalloonControllerTest, SizesTest) { | 84 TEST_F(BalloonControllerTest, SizesTest) { |
84 Notification n(GURL("http://www.google.com"), GURL("http://www.google.com"), | 85 Notification n(GURL("http://www.google.com"), GURL("http://www.google.com"), |
85 L"http://www.google.com", ASCIIToUTF16(""), | 86 L"http://www.google.com", ASCIIToUTF16(""), |
86 new NotificationObjectProxy(-1, -1, -1, false)); | 87 new NotificationObjectProxy(-1, -1, -1, false)); |
87 scoped_ptr<Balloon> balloon( | 88 scoped_ptr<Balloon> balloon( |
88 new Balloon(n, profile_.get(), collection_.get())); | 89 new Balloon(n, profile_.get(), collection_.get())); |
89 balloon->set_content_size(gfx::Size(100, 100)); | 90 balloon->set_content_size(gfx::Size(100, 100)); |
90 | 91 |
91 BalloonController* controller = [BalloonController alloc]; | 92 BalloonController* controller = [BalloonController alloc]; |
92 | 93 |
93 id mock = [OCMockObject partialMockForObject:controller]; | 94 id mock = [OCMockObject partialMockForObject:controller]; |
94 [[mock expect] initializeHost]; | 95 [[mock expect] initializeHost]; |
95 | 96 |
96 [controller initWithBalloon:balloon.get()]; | 97 [controller initWithBalloon:balloon.get()]; |
97 | 98 |
98 EXPECT_TRUE([controller desiredTotalWidth] > 100); | 99 EXPECT_TRUE([controller desiredTotalWidth] > 100); |
99 EXPECT_TRUE([controller desiredTotalHeight] > 100); | 100 EXPECT_TRUE([controller desiredTotalHeight] > 100); |
100 [mock verify]; | 101 [mock verify]; |
| 102 [controller release]; |
101 } | 103 } |
102 | 104 |
103 } | 105 } |
OLD | NEW |