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

Unified Diff: components/ntp_snippets/sessions/tab_delegate_sync_adapter_unittest.cc

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Use parameter Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/ntp_snippets/sessions/tab_delegate_sync_adapter_unittest.cc
diff --git a/components/ntp_snippets/sessions/tab_delegate_sync_adapter_unittest.cc b/components/ntp_snippets/sessions/tab_delegate_sync_adapter_unittest.cc
index b10c7d56f093f308f89710855367f5c2d4df8d4b..6b28496bc8e842be15af236dff9e72a50860509a 100644
--- a/components/ntp_snippets/sessions/tab_delegate_sync_adapter_unittest.cc
+++ b/components/ntp_snippets/sessions/tab_delegate_sync_adapter_unittest.cc
@@ -85,28 +85,28 @@ class TabDelegateSyncAdapterTest : public Test {
// having open tabs.
TEST_F(TabDelegateSyncAdapterTest, CallbackCount) {
ASSERT_EQ(0, CallbackCount());
- observer()->OnStateChanged();
+ observer()->OnStateChanged(&service_);
EXPECT_EQ(0, CallbackCount());
SetHasOpenTabs(true);
- observer()->OnStateChanged();
+ observer()->OnStateChanged(&service_);
EXPECT_EQ(1, CallbackCount());
- observer()->OnStateChanged();
+ observer()->OnStateChanged(&service_);
EXPECT_EQ(1, CallbackCount());
SetHasOpenTabs(false);
- observer()->OnStateChanged();
+ observer()->OnStateChanged(&service_);
EXPECT_EQ(2, CallbackCount());
- observer()->OnStateChanged();
+ observer()->OnStateChanged(&service_);
EXPECT_EQ(2, CallbackCount());
// OnSyncCycleCompleted should behave like OnStateChanged.
- observer()->OnSyncCycleCompleted();
+ observer()->OnSyncCycleCompleted(&service_);
EXPECT_EQ(2, CallbackCount());
SetHasOpenTabs(true);
- observer()->OnSyncCycleCompleted();
+ observer()->OnSyncCycleCompleted(&service_);
EXPECT_EQ(3, CallbackCount());
- observer()->OnSyncCycleCompleted();
+ observer()->OnSyncCycleCompleted(&service_);
EXPECT_EQ(3, CallbackCount());
}
@@ -114,26 +114,26 @@ TEST_F(TabDelegateSyncAdapterTest, CallbackCount) {
TEST_F(TabDelegateSyncAdapterTest, OnSyncConfigurationCompleted) {
ASSERT_EQ(0, CallbackCount());
- observer()->OnSyncConfigurationCompleted();
+ observer()->OnSyncConfigurationCompleted(&service_);
EXPECT_EQ(0, CallbackCount());
SetHasOpenTabs(true);
- observer()->OnSyncConfigurationCompleted();
+ observer()->OnSyncConfigurationCompleted(&service_);
EXPECT_EQ(0, CallbackCount());
}
// OnForeignSessionUpdated should always trigger a callback.
TEST_F(TabDelegateSyncAdapterTest, OnForeignSessionUpdated) {
ASSERT_EQ(0, CallbackCount());
- observer()->OnForeignSessionUpdated();
+ observer()->OnForeignSessionUpdated(&service_);
EXPECT_EQ(1, CallbackCount());
- observer()->OnForeignSessionUpdated();
+ observer()->OnForeignSessionUpdated(&service_);
EXPECT_EQ(2, CallbackCount());
SetHasOpenTabs(true);
- observer()->OnForeignSessionUpdated();
+ observer()->OnForeignSessionUpdated(&service_);
EXPECT_EQ(3, CallbackCount());
- observer()->OnForeignSessionUpdated();
+ observer()->OnForeignSessionUpdated(&service_);
EXPECT_EQ(4, CallbackCount());
}
@@ -141,10 +141,10 @@ TEST_F(TabDelegateSyncAdapterTest, OnForeignSessionUpdated) {
// OnStateChanged should not trigger a callback.
TEST_F(TabDelegateSyncAdapterTest, OnForeignSessionUpdatedUpdatesState) {
SetHasOpenTabs(true);
- observer()->OnForeignSessionUpdated();
+ observer()->OnForeignSessionUpdated(&service_);
EXPECT_EQ(1, CallbackCount());
- observer()->OnStateChanged();
+ observer()->OnStateChanged(&service_);
EXPECT_EQ(1, CallbackCount());
}

Powered by Google App Engine
This is Rietveld 408576698