OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extension_welcome_notification.h" | 5 #include "chrome/browser/notifications/extension_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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 210 |
211 // Overridden from NotificationDelegate: | 211 // Overridden from NotificationDelegate: |
212 virtual void Display() override {} | 212 virtual void Display() override {} |
213 virtual void Error() override {} | 213 virtual void Error() override {} |
214 virtual void Close(bool by_user) override {} | 214 virtual void Close(bool by_user) override {} |
215 virtual void Click() override {} | 215 virtual void Click() override {} |
216 virtual void ButtonClick(int index) override {} | 216 virtual void ButtonClick(int index) override {} |
217 | 217 |
218 virtual std::string id() const override { return id_; } | 218 virtual std::string id() const override { return id_; } |
219 | 219 |
220 virtual content::WebContents* GetWebContents() const override { | |
221 return NULL; | |
222 } | |
223 | |
224 private: | 220 private: |
225 virtual ~TestNotificationDelegate() {} | 221 virtual ~TestNotificationDelegate() {} |
226 | 222 |
227 const std::string id_; | 223 const std::string id_; |
228 | 224 |
229 DISALLOW_COPY_AND_ASSIGN(TestNotificationDelegate); | 225 DISALLOW_COPY_AND_ASSIGN(TestNotificationDelegate); |
230 }; | 226 }; |
231 | 227 |
232 void ShowNotification(std::string notification_id, | 228 void ShowNotification(std::string notification_id, |
233 const message_center::NotifierId& notifier_id) const { | 229 const message_center::NotifierId& notifier_id) const { |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 | 537 |
542 EXPECT_TRUE(task_runner()->GetPendingTasks().empty()); | 538 EXPECT_TRUE(task_runner()->GetPendingTasks().empty()); |
543 EXPECT_EQ(message_center()->add_notification_calls(), 0); | 539 EXPECT_EQ(message_center()->add_notification_calls(), 0); |
544 EXPECT_EQ(message_center()->remove_notification_calls(), 0); | 540 EXPECT_EQ(message_center()->remove_notification_calls(), 0); |
545 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0); | 541 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0); |
546 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed)); | 542 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed)); |
547 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal)); | 543 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal)); |
548 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp)); | 544 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp)); |
549 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 1); | 545 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 1); |
550 } | 546 } |
OLD | NEW |