OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #import "ui/message_center/cocoa/popup_controller.h" | 5 #import "ui/message_center/cocoa/popup_controller.h" |
6 | 6 |
7 #include "base/memory/scoped_nsobject.h" | 7 #include "base/memory/scoped_nsobject.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/sys_string_conversions.h" |
9 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
10 #include "base/sys_string_conversions.h" | |
11 #import "ui/base/test/ui_cocoa_test_helper.h" | 11 #import "ui/base/test/ui_cocoa_test_helper.h" |
12 #include "ui/message_center/notification.h" | 12 #include "ui/message_center/notification.h" |
13 #include "ui/message_center/notification_change_observer.h" | 13 #include "ui/message_center/notification_change_observer.h" |
14 | 14 |
15 class PopupControllerTest : public ui::CocoaTest { | 15 class PopupControllerTest : public ui::CocoaTest { |
16 }; | 16 }; |
17 | 17 |
18 TEST_F(PopupControllerTest, Creation) { | 18 TEST_F(PopupControllerTest, Creation) { |
19 scoped_ptr<message_center::Notification> notification( | 19 scoped_ptr<message_center::Notification> notification( |
20 new message_center::Notification( | 20 new message_center::Notification( |
21 message_center::NOTIFICATION_TYPE_SIMPLE, | 21 message_center::NOTIFICATION_TYPE_SIMPLE, |
22 "", | 22 "", |
23 ASCIIToUTF16("Added to circles"), | 23 ASCIIToUTF16("Added to circles"), |
24 ASCIIToUTF16("Jonathan and 5 others"), | 24 ASCIIToUTF16("Jonathan and 5 others"), |
25 string16(), | 25 string16(), |
26 std::string(), | 26 std::string(), |
27 NULL)); | 27 NULL)); |
28 | 28 |
29 scoped_nsobject<MCPopupController> controller( | 29 scoped_nsobject<MCPopupController> controller( |
30 [[MCPopupController alloc] initWithNotification:notification.get() | 30 [[MCPopupController alloc] initWithNotification:notification.get() |
31 changeObserver:NULL]); | 31 changeObserver:NULL]); |
32 | 32 |
33 EXPECT_TRUE([controller window]); | 33 EXPECT_TRUE([controller window]); |
34 EXPECT_EQ(notification.get(), [controller notification]); | 34 EXPECT_EQ(notification.get(), [controller notification]); |
35 | 35 |
36 [controller showWindow:nil]; | 36 [controller showWindow:nil]; |
37 [controller close]; | 37 [controller close]; |
38 } | 38 } |
OLD | NEW |