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

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

Issue 2335153002: Use TestSimpleTaskRunner::NumPendingTasks instead of GetPendingTasks().size() (Closed)
Patch Set: rebase Created 4 years, 3 months 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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp)); 475 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp));
476 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 0); 476 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 0);
477 EXPECT_TRUE(task_runner()->GetPendingTasks().empty()); 477 EXPECT_TRUE(task_runner()->GetPendingTasks().empty());
478 478
479 ShowChromeNowNotification(); 479 ShowChromeNowNotification();
480 480
481 base::TimeDelta requested_show_time = 481 base::TimeDelta requested_show_time =
482 base::TimeDelta::FromDays( 482 base::TimeDelta::FromDays(
483 ExtensionWelcomeNotification::kRequestedShowTimeDays); 483 ExtensionWelcomeNotification::kRequestedShowTimeDays);
484 484
485 EXPECT_EQ(task_runner()->GetPendingTasks().size(), 1U); 485 EXPECT_EQ(task_runner()->NumPendingTasks(), 1U);
486 EXPECT_EQ(task_runner()->NextPendingTaskDelay(), requested_show_time); 486 EXPECT_EQ(task_runner()->NextPendingTaskDelay(), requested_show_time);
487 487
488 EXPECT_EQ(message_center()->add_notification_calls(), 1); 488 EXPECT_EQ(message_center()->add_notification_calls(), 1);
489 EXPECT_EQ(message_center()->remove_notification_calls(), 0); 489 EXPECT_EQ(message_center()->remove_notification_calls(), 0);
490 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0); 490 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0);
491 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed)); 491 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed));
492 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal)); 492 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal));
493 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp)); 493 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp));
494 EXPECT_EQ( 494 EXPECT_EQ(
495 GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 495 GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp),
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 530
531 EXPECT_TRUE(task_runner()->GetPendingTasks().empty()); 531 EXPECT_TRUE(task_runner()->GetPendingTasks().empty());
532 EXPECT_EQ(message_center()->add_notification_calls(), 0); 532 EXPECT_EQ(message_center()->add_notification_calls(), 0);
533 EXPECT_EQ(message_center()->remove_notification_calls(), 0); 533 EXPECT_EQ(message_center()->remove_notification_calls(), 0);
534 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0); 534 EXPECT_EQ(message_center()->notifications_with_shown_as_popup(), 0);
535 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed)); 535 EXPECT_FALSE(GetBooleanPref(prefs::kWelcomeNotificationDismissed));
536 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal)); 536 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationDismissedLocal));
537 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp)); 537 EXPECT_TRUE(GetBooleanPref(prefs::kWelcomeNotificationPreviouslyPoppedUp));
538 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 1); 538 EXPECT_EQ(GetInt64Pref(prefs::kWelcomeNotificationExpirationTimestamp), 1);
539 } 539 }
OLDNEW
« no previous file with comments | « base/task/cancelable_task_tracker_unittest.cc ('k') | extensions/common/one_shot_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698