Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: chrome/browser/notifications/extension_welcome_notification_unittest.cc

Issue 684253002: Provide default implementations for NotificationDelegate methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 void SetInt64Pref(const char* path, int64 value) const { 198 void SetInt64Pref(const char* path, int64 value) const {
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 {}
209 void Error() override {}
210 void Close(bool by_user) override {}
211 void Click() override {}
212 void ButtonClick(int index) override {}
213
214 std::string id() const override { return id_; } 208 std::string id() const override { return id_; }
215 209
216 private: 210 private:
217 ~TestNotificationDelegate() override {} 211 ~TestNotificationDelegate() override {}
218 212
219 const std::string id_; 213 const std::string id_;
220 214
221 DISALLOW_COPY_AND_ASSIGN(TestNotificationDelegate); 215 DISALLOW_COPY_AND_ASSIGN(TestNotificationDelegate);
222 }; 216 };
223 217
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 527
534 EXPECT_TRUE(task_runner()->GetPendingTasks().empty()); 528 EXPECT_TRUE(task_runner()->GetPendingTasks().empty());
535 EXPECT_EQ(message_center()->add_notification_calls(), 0); 529 EXPECT_EQ(message_center()->add_notification_calls(), 0);
536 EXPECT_EQ(message_center()->remove_notification_calls(), 0); 530 EXPECT_EQ(message_center()->remove_notification_calls(), 0);
537 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0); 531 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0);
538 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed)); 532 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed));
539 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal)); 533 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal));
540 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp)); 534 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp));
541 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 1); 535 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 1);
542 } 536 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/extension_welcome_notification.cc ('k') | chrome/browser/notifications/notification_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698