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