 Chromium Code Reviews
 Chromium Code Reviews Issue 2753753005:
  [sync] WebContentsObserver based sessions notifications  (Closed)
    
  
    Issue 2753753005:
  [sync] WebContentsObserver based sessions notifications  (Closed) 
  | Index: components/sync_sessions/sessions_sync_manager_unittest.cc | 
| diff --git a/components/sync_sessions/sessions_sync_manager_unittest.cc b/components/sync_sessions/sessions_sync_manager_unittest.cc | 
| index ab5cbfde94db4bca324d1de09698e5347f57bed4..8896d834e16f2a73c11d34e43a3442a1e0b0d45c 100644 | 
| --- a/components/sync_sessions/sessions_sync_manager_unittest.cc | 
| +++ b/components/sync_sessions/sessions_sync_manager_unittest.cc | 
| @@ -211,6 +211,8 @@ class TestSyncedTabDelegate : public SyncedTabDelegate { | 
| return http_count > 0; | 
| } | 
| + SessionID::id_type GetSourceTabID() const override { return -1; } | 
| 
Nicolas Zea
2017/03/16 19:57:44
Would it be possible to use kUnknownTabId here 
(a
 
Patrick Noland
2017/03/16 20:23:27
Done.
 | 
| + | 
| void AppendEntry(std::unique_ptr<sessions::SerializedNavigationEntry> entry) { | 
| entries_.push_back(std::move(entry)); | 
| } | 
| @@ -322,6 +324,8 @@ class PlaceholderTabDelegate : public SyncedTabDelegate { | 
| return false; | 
| } | 
| + SessionID::id_type GetSourceTabID() const override { return -1; } | 
| + | 
| private: | 
| SessionID::id_type session_id_; | 
| int sync_id_; | 
| @@ -512,9 +516,10 @@ class SessionsSyncManagerTest : public testing::Test { | 
| base::MakeUnique<SyncSessionsClientShim>(&window_getter_); | 
| sync_prefs_ = | 
| base::MakeUnique<syncer::SyncPrefs>(sync_client_->GetPrefService()); | 
| + router_ = base::MakeUnique<DummyRouter>(); | 
| manager_ = base::MakeUnique<SessionsSyncManager>( | 
| sessions_client_shim(), sync_prefs_.get(), local_device_.get(), | 
| - std::unique_ptr<LocalSessionEventRouter>(NewDummyRouter()), | 
| + router_.get(), | 
| base::Bind(&SessionNotificationObserver::NotifyOfUpdate, | 
| base::Unretained(&observer_)), | 
| base::Bind(&SessionNotificationObserver::NotifyOfRefresh, | 
| @@ -546,12 +551,6 @@ class SessionsSyncManagerTest : public testing::Test { | 
| } | 
| SyncedWindowDelegatesGetter* window_getter() { return &window_getter_; } | 
| - std::unique_ptr<LocalSessionEventRouter> NewDummyRouter() { | 
| - std::unique_ptr<DummyRouter> router(new DummyRouter()); | 
| - router_ = router.get(); | 
| - return std::unique_ptr<LocalSessionEventRouter>(std::move(router)); | 
| - } | 
| - | 
| void InitWithSyncDataTakeOutput(const SyncDataList& initial_data, | 
| SyncChangeList* output) { | 
| test_processor_ = new TestSyncChangeProcessor(output); | 
| @@ -728,7 +727,7 @@ class SessionsSyncManagerTest : public testing::Test { | 
| std::unique_ptr<SyncSessionsClientShim> sessions_client_shim_; | 
| std::unique_ptr<syncer::SyncPrefs> sync_prefs_; | 
| SessionNotificationObserver observer_; | 
| - DummyRouter* router_ = nullptr; | 
| + std::unique_ptr<DummyRouter> router_; | 
| std::unique_ptr<SessionsSyncManager> manager_; | 
| SessionSyncTestHelper helper_; | 
| TestSyncChangeProcessor* test_processor_ = nullptr; |