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 #include "ui/message_center/views/message_popup_collection.h" | 5 #include "ui/message_center/views/message_popup_collection.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 | 84 |
85 std::string AddNotification() { | 85 std::string AddNotification() { |
86 std::string id = base::IntToString(id_++); | 86 std::string id = base::IntToString(id_++); |
87 scoped_ptr<Notification> notification( | 87 scoped_ptr<Notification> notification( |
88 new Notification(NOTIFICATION_TYPE_BASE_FORMAT, | 88 new Notification(NOTIFICATION_TYPE_BASE_FORMAT, |
89 id, | 89 id, |
90 UTF8ToUTF16("test title"), | 90 UTF8ToUTF16("test title"), |
91 UTF8ToUTF16("test message"), | 91 UTF8ToUTF16("test message"), |
92 gfx::Image(), | 92 gfx::Image(), |
93 string16() /* display_source */, | 93 base::string16() /* display_source */, |
94 NotifierId(), | 94 NotifierId(), |
95 message_center::RichNotificationData(), | 95 message_center::RichNotificationData(), |
96 NULL /* delegate */)); | 96 NULL /* delegate */)); |
97 MessageCenter::Get()->AddNotification(notification.Pass()); | 97 MessageCenter::Get()->AddNotification(notification.Pass()); |
98 return id; | 98 return id; |
99 } | 99 } |
100 | 100 |
101 void PrepareForWait() { collection_->CreateRunLoopForTest(); } | 101 void PrepareForWait() { collection_->CreateRunLoopForTest(); } |
102 | 102 |
103 // Assumes there is non-zero pending work. | 103 // Assumes there is non-zero pending work. |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 std::string id2 = AddNotification(); | 402 std::string id2 = AddNotification(); |
403 | 403 |
404 WaitForTransitionsDone(); | 404 WaitForTransitionsDone(); |
405 views::WidgetDelegateView* toast2 = GetToast(id2); | 405 views::WidgetDelegateView* toast2 = GetToast(id2); |
406 EXPECT_TRUE(toast2 != NULL); | 406 EXPECT_TRUE(toast2 != NULL); |
407 } | 407 } |
408 | 408 |
409 | 409 |
410 } // namespace test | 410 } // namespace test |
411 } // namespace message_center | 411 } // namespace message_center |
OLD | NEW |