OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This class defines tests that implementations of Invalidator should pass in | 5 // This class defines tests that implementations of Invalidator should pass in |
6 // order to be conformant. Here's how you use it to test your implementation. | 6 // order to be conformant. Here's how you use it to test your implementation. |
7 // | 7 // |
8 // Say your class is called MyInvalidator. Then you need to define a class | 8 // Say your class is called MyInvalidator. Then you need to define a class |
9 // called MyInvalidatorTestDelegate in my_sync_notifier_unittest.cc like this: | 9 // called MyInvalidatorTestDelegate in my_sync_notifier_unittest.cc like this: |
10 // | 10 // |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 public: | 333 public: |
334 explicit BoundFakeInvalidationHandler(const Invalidator& invalidator); | 334 explicit BoundFakeInvalidationHandler(const Invalidator& invalidator); |
335 virtual ~BoundFakeInvalidationHandler(); | 335 virtual ~BoundFakeInvalidationHandler(); |
336 | 336 |
337 // Returns the last return value of GetInvalidatorState() on the | 337 // Returns the last return value of GetInvalidatorState() on the |
338 // bound invalidator from the last time the invalidator state | 338 // bound invalidator from the last time the invalidator state |
339 // changed. | 339 // changed. |
340 InvalidatorState GetLastRetrievedState() const; | 340 InvalidatorState GetLastRetrievedState() const; |
341 | 341 |
342 // InvalidationHandler implementation. | 342 // InvalidationHandler implementation. |
343 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; | 343 virtual void OnInvalidatorStateChange(InvalidatorState state) override; |
344 | 344 |
345 private: | 345 private: |
346 const Invalidator& invalidator_; | 346 const Invalidator& invalidator_; |
347 InvalidatorState last_retrieved_state_; | 347 InvalidatorState last_retrieved_state_; |
348 | 348 |
349 DISALLOW_COPY_AND_ASSIGN(BoundFakeInvalidationHandler); | 349 DISALLOW_COPY_AND_ASSIGN(BoundFakeInvalidationHandler); |
350 }; | 350 }; |
351 | 351 |
352 } // namespace internal | 352 } // namespace internal |
353 | 353 |
(...skipping 14 matching lines...) Expand all Loading... |
368 invalidator->UnregisterHandler(&handler); | 368 invalidator->UnregisterHandler(&handler); |
369 } | 369 } |
370 | 370 |
371 REGISTER_TYPED_TEST_CASE_P(InvalidatorTest, | 371 REGISTER_TYPED_TEST_CASE_P(InvalidatorTest, |
372 Basic, MultipleHandlers, EmptySetUnregisters, | 372 Basic, MultipleHandlers, EmptySetUnregisters, |
373 GetInvalidatorStateAlwaysCurrent); | 373 GetInvalidatorStateAlwaysCurrent); |
374 | 374 |
375 } // namespace syncer | 375 } // namespace syncer |
376 | 376 |
377 #endif // COMPONENTS_INVALIDATION_INVALIDATOR_TEST_TEMPLATE_H_ | 377 #endif // COMPONENTS_INVALIDATION_INVALIDATOR_TEST_TEMPLATE_H_ |
OLD | NEW |