| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |