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

Side by Side Diff: sync/notifier/invalidator_registrar_unittest.cc

Issue 221963003: Reduce dependency of TiclInvalidationService on Profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made InvalidationStateTracker not vend WeakPtrs. Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "google/cacheinvalidation/types.pb.h" 8 #include "google/cacheinvalidation/types.pb.h"
9 #include "sync/notifier/fake_invalidation_handler.h" 9 #include "sync/notifier/fake_invalidation_handler.h"
10 #include "sync/notifier/invalidator_registrar.h" 10 #include "sync/notifier/invalidator_registrar.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 public: 66 public:
67 RegistrarInvalidatorTestDelegate() {} 67 RegistrarInvalidatorTestDelegate() {}
68 68
69 ~RegistrarInvalidatorTestDelegate() { 69 ~RegistrarInvalidatorTestDelegate() {
70 DestroyInvalidator(); 70 DestroyInvalidator();
71 } 71 }
72 72
73 void CreateInvalidator( 73 void CreateInvalidator(
74 const std::string& invalidator_client_id, 74 const std::string& invalidator_client_id,
75 const std::string& initial_state, 75 const std::string& initial_state,
76 const base::WeakPtr<InvalidationStateTracker>& 76 InvalidationStateTracker* invalidation_state_tracker) {
77 invalidation_state_tracker) {
78 DCHECK(!invalidator_.get()); 77 DCHECK(!invalidator_.get());
79 invalidator_.reset(new RegistrarInvalidator()); 78 invalidator_.reset(new RegistrarInvalidator());
80 } 79 }
81 80
82 RegistrarInvalidator* GetInvalidator() { 81 RegistrarInvalidator* GetInvalidator() {
83 return invalidator_.get(); 82 return invalidator_.get();
84 } 83 }
85 84
86 void DestroyInvalidator() { 85 void DestroyInvalidator() {
87 invalidator_.reset(); 86 invalidator_.reset();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 EXPECT_DEATH({ registrar.UpdateRegisteredIds(&handler2, ids); }, ""); 153 EXPECT_DEATH({ registrar.UpdateRegisteredIds(&handler2, ids); }, "");
155 154
156 registrar.UnregisterHandler(&handler2); 155 registrar.UnregisterHandler(&handler2);
157 registrar.UnregisterHandler(&handler1); 156 registrar.UnregisterHandler(&handler1);
158 } 157 }
159 #endif // GTEST_HAS_DEATH_TEST 158 #endif // GTEST_HAS_DEATH_TEST
160 159
161 } // namespace 160 } // namespace
162 161
163 } // namespace syncer 162 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698