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.h" | 9 #include "base/message_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 collection_->toasts_.begin(); | 61 collection_->toasts_.begin(); |
62 iter != collection_->toasts_.end(); ++iter) { | 62 iter != collection_->toasts_.end(); ++iter) { |
63 if ((*iter)->id() == id) | 63 if ((*iter)->id() == id) |
64 return *iter; | 64 return *iter; |
65 } | 65 } |
66 return NULL; | 66 return NULL; |
67 } | 67 } |
68 | 68 |
69 std::string AddNotification() { | 69 std::string AddNotification() { |
70 std::string id = base::IntToString(id_++); | 70 std::string id = base::IntToString(id_++); |
71 MessageCenter::Get()->AddNotification( | 71 MessageCenter::Get()->AddNotification(NOTIFICATION_TYPE_BASE_FORMAT, |
72 NOTIFICATION_TYPE_BASE_FORMAT, id, UTF8ToUTF16("test title"), | 72 id, |
73 UTF8ToUTF16("test message"), string16() /* display_source */, | 73 UTF8ToUTF16("test title"), |
74 "" /* extension_id */, NULL); | 74 UTF8ToUTF16("test message"), |
| 75 string16() /* display_source */, |
| 76 "" /* extension_id */, |
| 77 NULL /* optional_fields */, |
| 78 NULL /* delegate */); |
75 return id; | 79 return id; |
76 } | 80 } |
77 | 81 |
78 // Assumes there is non-zero pending work. | 82 // Assumes there is non-zero pending work. |
79 void WaitForTransitionsDone() { | 83 void WaitForTransitionsDone() { |
80 collection_->RunLoopForTest(); | 84 collection_->RunLoopForTest(); |
81 } | 85 } |
82 | 86 |
83 void CloseAllToastsAndWait() { | 87 void CloseAllToastsAndWait() { |
84 // Assumes there is at least one toast to close. | 88 // Assumes there is at least one toast to close. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 171 |
168 CloseAllToastsAndWait(); | 172 CloseAllToastsAndWait(); |
169 EXPECT_EQ(0u, GetToastCounts()); | 173 EXPECT_EQ(0u, GetToastCounts()); |
170 } | 174 } |
171 | 175 |
172 // TODO(dimich): Test repositioning - both normal one and when user is closing | 176 // TODO(dimich): Test repositioning - both normal one and when user is closing |
173 // the toasts. | 177 // the toasts. |
174 | 178 |
175 } // namespace test | 179 } // namespace test |
176 } // namespace message_center | 180 } // namespace message_center |
OLD | NEW |