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/message_center_tray.h" | 5 #include "ui/message_center/message_center_tray.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 base::string16 display_source = ASCIIToUTF16("www.test.org"); | 293 base::string16 display_source = ASCIIToUTF16("www.test.org"); |
294 NotifierId notifier_id = DummyNotifierId(); | 294 NotifierId notifier_id = DummyNotifierId(); |
295 | 295 |
296 NotifierId notifier_id2(NotifierId::APPLICATION, "sample-app"); | 296 NotifierId notifier_id2(NotifierId::APPLICATION, "sample-app"); |
297 scoped_ptr<Notification> notification(new Notification( | 297 scoped_ptr<Notification> notification(new Notification( |
298 message_center::NOTIFICATION_TYPE_SIMPLE, id2, | 298 message_center::NOTIFICATION_TYPE_SIMPLE, id2, |
299 ASCIIToUTF16("Test Web Notification"), | 299 ASCIIToUTF16("Test Web Notification"), |
300 ASCIIToUTF16("Notification message body."), gfx::Image(), | 300 ASCIIToUTF16("Notification message body."), gfx::Image(), |
301 base::string16() /* empty display source */, GURL(), notifier_id2, | 301 base::string16() /* empty display source */, GURL(), notifier_id2, |
302 message_center::RichNotificationData(), NULL /* delegate */)); | 302 message_center::RichNotificationData(), NULL /* delegate */)); |
303 message_center_->AddNotification(notification.Pass()); | 303 message_center_->AddNotification(std::move(notification)); |
304 | 304 |
305 AddNotification(id3); | 305 AddNotification(id3); |
306 | 306 |
307 scoped_ptr<ui::MenuModel> model( | 307 scoped_ptr<ui::MenuModel> model( |
308 message_center_tray_->CreateNotificationMenuModel( | 308 message_center_tray_->CreateNotificationMenuModel( |
309 notifier_id, display_source)); | 309 notifier_id, display_source)); |
310 EXPECT_EQ(2, model->GetItemCount()); | 310 EXPECT_EQ(2, model->GetItemCount()); |
311 const int second_command = model->GetCommandIdAt(1); | 311 const int second_command = model->GetCommandIdAt(1); |
312 | 312 |
313 // The second item is to open the settings. | 313 // The second item is to open the settings. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 EXPECT_EQ(1, model->GetItemCount()); | 410 EXPECT_EQ(1, model->GetItemCount()); |
411 #else | 411 #else |
412 EXPECT_EQ(2, model->GetItemCount()); | 412 EXPECT_EQ(2, model->GetItemCount()); |
413 EXPECT_FALSE(model->IsEnabledAt(1)); | 413 EXPECT_FALSE(model->IsEnabledAt(1)); |
414 #endif | 414 #endif |
415 | 415 |
416 EXPECT_FALSE(model->IsEnabledAt(0)); | 416 EXPECT_FALSE(model->IsEnabledAt(0)); |
417 } | 417 } |
418 | 418 |
419 } // namespace message_center | 419 } // namespace message_center |
OLD | NEW |