| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/notifications/welcome_notification.h" | 5 #include "chrome/browser/notifications/welcome_notification.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 std::string notification_id, | 146 std::string notification_id, |
| 147 const message_center::NotifierId& notifier_id) { | 147 const message_center::NotifierId& notifier_id) { |
| 148 message_center::RichNotificationData rich_notification_data; | 148 message_center::RichNotificationData rich_notification_data; |
| 149 rich_notification_data.priority = 0; | 149 rich_notification_data.priority = 0; |
| 150 Notification notification( | 150 Notification notification( |
| 151 message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 151 message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
| 152 GURL("http://tests.url"), | 152 GURL("http://tests.url"), |
| 153 base::UTF8ToUTF16("Title"), | 153 base::UTF8ToUTF16("Title"), |
| 154 base::UTF8ToUTF16("Body"), | 154 base::UTF8ToUTF16("Body"), |
| 155 gfx::Image(), | 155 gfx::Image(), |
| 156 WebKit::WebTextDirectionDefault, | 156 blink::WebTextDirectionDefault, |
| 157 notifier_id, | 157 notifier_id, |
| 158 base::UTF8ToUTF16("Source"), | 158 base::UTF8ToUTF16("Source"), |
| 159 base::UTF8ToUTF16(notification_id), | 159 base::UTF8ToUTF16(notification_id), |
| 160 rich_notification_data, | 160 rich_notification_data, |
| 161 new TestNotificationDelegate("TestNotification")); | 161 new TestNotificationDelegate("TestNotification")); |
| 162 welcome_notification_->ShowWelcomeNotificationIfNecessary(notification); | 162 welcome_notification_->ShowWelcomeNotificationIfNecessary(notification); |
| 163 } | 163 } |
| 164 | 164 |
| 165 scoped_ptr<TestingProfile> profile_; | 165 scoped_ptr<TestingProfile> profile_; |
| 166 scoped_ptr<MockMessageCenter> message_center_; | 166 scoped_ptr<MockMessageCenter> message_center_; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 290 |
| 291 EXPECT_TRUE(message_center()->add_notification_calls() == 1); | 291 EXPECT_TRUE(message_center()->add_notification_calls() == 1); |
| 292 EXPECT_TRUE(message_center()->remove_notification_calls() == 1); | 292 EXPECT_TRUE(message_center()->remove_notification_calls() == 1); |
| 293 EXPECT_TRUE(message_center()->notifications_with_shown_as_popup() == 0); | 293 EXPECT_TRUE(message_center()->notifications_with_shown_as_popup() == 0); |
| 294 EXPECT_TRUE( | 294 EXPECT_TRUE( |
| 295 profile()->GetPrefs()->GetBoolean(prefs::kWelcomeNotificationDismissed)); | 295 profile()->GetPrefs()->GetBoolean(prefs::kWelcomeNotificationDismissed)); |
| 296 EXPECT_TRUE( | 296 EXPECT_TRUE( |
| 297 profile()->GetPrefs()->GetBoolean( | 297 profile()->GetPrefs()->GetBoolean( |
| 298 prefs::kWelcomeNotificationPreviouslyPoppedUp)); | 298 prefs::kWelcomeNotificationPreviouslyPoppedUp)); |
| 299 } | 299 } |
| OLD | NEW |