| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "ui/message_center/views/message_center_view.h" | 5 #include "ui/message_center/views/message_center_view.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 base::UTF8ToUTF16("display source"), GURL(), | 191 base::UTF8ToUTF16("display source"), GURL(), |
| 192 NotifierId(NotifierId::APPLICATION, "extension_id"), | 192 NotifierId(NotifierId::APPLICATION, "extension_id"), |
| 193 message_center::RichNotificationData(), NULL); | 193 message_center::RichNotificationData(), NULL); |
| 194 | 194 |
| 195 // ...and a list for it. | 195 // ...and a list for it. |
| 196 notifications_.insert(notification1); | 196 notifications_.insert(notification1); |
| 197 notifications_.insert(notification2); | 197 notifications_.insert(notification2); |
| 198 message_center_->SetVisibleNotifications(notifications_); | 198 message_center_->SetVisibleNotifications(notifications_); |
| 199 | 199 |
| 200 // Then create a new MessageCenterView with that single notification. | 200 // Then create a new MessageCenterView with that single notification. |
| 201 base::string16 title; | |
| 202 message_center_view_.reset(new MessageCenterView( | 201 message_center_view_.reset(new MessageCenterView( |
| 203 message_center_.get(), NULL, 100, false, /*top_down =*/false, title)); | 202 message_center_.get(), NULL, 100, false, /*top_down =*/false)); |
| 204 GetMessageListView()->quit_message_loop_after_animation_for_test_ = true; | 203 GetMessageListView()->quit_message_loop_after_animation_for_test_ = true; |
| 205 GetMessageCenterView()->SetBounds(0, 0, 380, 600); | 204 GetMessageCenterView()->SetBounds(0, 0, 380, 600); |
| 206 message_center_view_->SetNotifications(notifications_); | 205 message_center_view_->SetNotifications(notifications_); |
| 207 | 206 |
| 208 // Wait until the animation finishes if available. | 207 // Wait until the animation finishes if available. |
| 209 if (GetAnimator()->IsAnimating()) | 208 if (GetAnimator()->IsAnimating()) |
| 210 base::MessageLoop::current()->Run(); | 209 base::MessageLoop::current()->Run(); |
| 211 } | 210 } |
| 212 | 211 |
| 213 void MessageCenterViewTest::TearDown() { | 212 void MessageCenterViewTest::TearDown() { |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 AddNotification( | 593 AddNotification( |
| 595 std::unique_ptr<Notification>(new Notification(pinned_notification))); | 594 std::unique_ptr<Notification>(new Notification(pinned_notification))); |
| 596 | 595 |
| 597 // There should be 1 pinned notification. | 596 // There should be 1 pinned notification. |
| 598 EXPECT_EQ(1u, GetMessageCenter()->GetVisibleNotifications().size()); | 597 EXPECT_EQ(1u, GetMessageCenter()->GetVisibleNotifications().size()); |
| 599 EXPECT_FALSE(close_button->enabled()); | 598 EXPECT_FALSE(close_button->enabled()); |
| 600 #endif // defined(OS_CHROMEOS) | 599 #endif // defined(OS_CHROMEOS) |
| 601 } | 600 } |
| 602 | 601 |
| 603 } // namespace message_center | 602 } // namespace message_center |
| OLD | NEW |