| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 profile_->GetPrefs()->SetInt64(path, value); | 199 profile_->GetPrefs()->SetInt64(path, value); |
| 200 } | 200 } |
| 201 | 201 |
| 202 private: | 202 private: |
| 203 class TestNotificationDelegate : public NotificationDelegate { | 203 class TestNotificationDelegate : public NotificationDelegate { |
| 204 public: | 204 public: |
| 205 explicit TestNotificationDelegate(const std::string& id) : id_(id) {} | 205 explicit TestNotificationDelegate(const std::string& id) : id_(id) {} |
| 206 | 206 |
| 207 // Overridden from NotificationDelegate: | 207 // Overridden from NotificationDelegate: |
| 208 void Display() override {} | 208 void Display() override {} |
| 209 void Error() override {} | |
| 210 void Close(bool by_user) override {} | 209 void Close(bool by_user) override {} |
| 211 void Click() override {} | 210 void Click() override {} |
| 212 void ButtonClick(int index) override {} | 211 void ButtonClick(int index) override {} |
| 213 | 212 |
| 214 std::string id() const override { return id_; } | 213 std::string id() const override { return id_; } |
| 215 | 214 |
| 216 private: | 215 private: |
| 217 ~TestNotificationDelegate() override {} | 216 ~TestNotificationDelegate() override {} |
| 218 | 217 |
| 219 const std::string id_; | 218 const std::string id_; |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 | 532 |
| 534 EXPECT_TRUE(task_runner()->GetPendingTasks().empty()); | 533 EXPECT_TRUE(task_runner()->GetPendingTasks().empty()); |
| 535 EXPECT_EQ(message_center()->add_notification_calls(), 0); | 534 EXPECT_EQ(message_center()->add_notification_calls(), 0); |
| 536 EXPECT_EQ(message_center()->remove_notification_calls(), 0); | 535 EXPECT_EQ(message_center()->remove_notification_calls(), 0); |
| 537 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0); | 536 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0); |
| 538 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed)); | 537 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed)); |
| 539 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal)); | 538 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal)); |
| 540 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp)); | 539 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp)); |
| 541 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 1); | 540 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 1); |
| 542 } | 541 } |
| OLD | NEW |