| Index: sync/notifier/sync_invalidation_listener_unittest.cc
|
| diff --git a/sync/notifier/sync_invalidation_listener_unittest.cc b/sync/notifier/sync_invalidation_listener_unittest.cc
|
| index 5fd9442ae174cb49f46f48ef259451d3a50cd823..29276bd02fdcdb4818310c22fd14fde2214570d2 100644
|
| --- a/sync/notifier/sync_invalidation_listener_unittest.cc
|
| +++ b/sync/notifier/sync_invalidation_listener_unittest.cc
|
| @@ -282,7 +282,8 @@ class SyncInvalidationListenerTest : public testing::Test {
|
| fake_invalidation_client_(NULL),
|
| listener_(scoped_ptr<SyncNetworkChannel>(new PushClientChannel(
|
| scoped_ptr<notifier::PushClient>(fake_push_client_)))),
|
| - fake_delegate_(&listener_) {}
|
| + fake_delegate_(&listener_),
|
| + invalidation_state_tracker_weak_ptr_factory_(&fake_tracker_) {}
|
|
|
| virtual void SetUp() {
|
| StartClient();
|
| @@ -294,6 +295,7 @@ class SyncInvalidationListenerTest : public testing::Test {
|
|
|
| virtual void TearDown() {
|
| StopClient();
|
| + invalidation_state_tracker_weak_ptr_factory_.InvalidateWeakPtrs();
|
| }
|
|
|
| // Restart client without re-registering IDs.
|
| @@ -304,12 +306,13 @@ class SyncInvalidationListenerTest : public testing::Test {
|
|
|
| void StartClient() {
|
| fake_invalidation_client_ = NULL;
|
| - listener_.Start(base::Bind(&CreateFakeInvalidationClient,
|
| - &fake_invalidation_client_),
|
| - kClientId, kClientInfo, kState,
|
| - fake_tracker_.GetSavedInvalidations(),
|
| - MakeWeakHandle(fake_tracker_.AsWeakPtr()),
|
| - &fake_delegate_);
|
| + listener_.Start(
|
| + base::Bind(&CreateFakeInvalidationClient, &fake_invalidation_client_),
|
| + kClientId, kClientInfo, kState,
|
| + fake_tracker_.GetSavedInvalidations(),
|
| + MakeWeakHandle(
|
| + invalidation_state_tracker_weak_ptr_factory_.GetWeakPtr()),
|
| + &fake_delegate_);
|
| DCHECK(fake_invalidation_client_);
|
| }
|
|
|
| @@ -464,7 +467,7 @@ class SyncInvalidationListenerTest : public testing::Test {
|
| notifier::FakePushClient* const fake_push_client_;
|
|
|
| protected:
|
| - // A derrived test needs direct access to this.
|
| + // A derived test needs direct access to this.
|
| FakeInvalidationStateTracker fake_tracker_;
|
|
|
| // Tests need to access these directly.
|
| @@ -473,6 +476,9 @@ class SyncInvalidationListenerTest : public testing::Test {
|
|
|
| private:
|
| FakeDelegate fake_delegate_;
|
| +
|
| + base::WeakPtrFactory<InvalidationStateTracker>
|
| + invalidation_state_tracker_weak_ptr_factory_;
|
| };
|
|
|
| // Write a new state to the client. It should propagate to the
|
|
|