| 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 <map> | 5 #include <map> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 Notification CreateRichTestNotification(const std::string& id, | 114 Notification CreateRichTestNotification(const std::string& id, |
| 115 TestDelegate** delegate = NULL) { | 115 TestDelegate** delegate = NULL) { |
| 116 TestDelegate* new_delegate = new TestDelegate(id); | 116 TestDelegate* new_delegate = new TestDelegate(id); |
| 117 if (delegate) { | 117 if (delegate) { |
| 118 *delegate = new_delegate; | 118 *delegate = new_delegate; |
| 119 new_delegate->AddRef(); | 119 new_delegate->AddRef(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 message_center::RichNotificationData data; | 122 message_center::RichNotificationData data; |
| 123 | 123 |
| 124 return Notification(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 124 return Notification( |
| 125 GURL("chrome-test://testing/"), | 125 message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
| 126 base::ASCIIToUTF16("title"), | 126 base::ASCIIToUTF16("title"), base::ASCIIToUTF16("message"), |
| 127 base::ASCIIToUTF16("message"), | 127 gfx::Image(), |
| 128 gfx::Image(), | 128 message_center::NotifierId(message_center::NotifierId::APPLICATION, |
| 129 message_center::NotifierId( | 129 "extension_id"), |
| 130 message_center::NotifierId::APPLICATION, | 130 base::UTF8ToUTF16("chrome-test://testing/"), |
| 131 "extension_id"), | 131 GURL("chrome-test://testing/"), "REPLACE-ME", data, new_delegate); |
| 132 base::UTF8ToUTF16("chrome-test://testing/"), | |
| 133 "REPLACE-ME", | |
| 134 data, | |
| 135 new_delegate); | |
| 136 } | 132 } |
| 137 }; | 133 }; |
| 138 | 134 |
| 139 // TODO(rsesek): Implement Message Center on Mac and get these tests passing | 135 // TODO(rsesek): Implement Message Center on Mac and get these tests passing |
| 140 // for real. http://crbug.com/179904 | 136 // for real. http://crbug.com/179904 |
| 141 #if !defined(OS_MACOSX) | 137 #if !defined(OS_MACOSX) |
| 142 | 138 |
| 143 IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, RetrieveBaseParts) { | 139 IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, RetrieveBaseParts) { |
| 144 EXPECT_TRUE(manager()); | 140 EXPECT_TRUE(manager()); |
| 145 EXPECT_TRUE(message_center()); | 141 EXPECT_TRUE(message_center()); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 manager()->Update(notification, profile()); | 353 manager()->Update(notification, profile()); |
| 358 | 354 |
| 359 // Expect that the progress notification update is performed. | 355 // Expect that the progress notification update is performed. |
| 360 EXPECT_EQ(base::StringPrintf("update-%s", notification_id.c_str()), | 356 EXPECT_EQ(base::StringPrintf("update-%s", notification_id.c_str()), |
| 361 observer.log(notification_id)); | 357 observer.log(notification_id)); |
| 362 | 358 |
| 363 delegate->Release(); | 359 delegate->Release(); |
| 364 } | 360 } |
| 365 | 361 |
| 366 #endif // !defined(OS_MACOSX) | 362 #endif // !defined(OS_MACOSX) |
| OLD | NEW |