Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: ui/message_center/views/message_popup_collection_unittest.cc

Issue 15582004: Move NotificationDelegate into message_center. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the ever-changing Mac unit tests. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/message_center/views/message_center_view_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/message_center/views/message_center_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698