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

Side by Side Diff: components/invalidation/invalidation_service_test_template.h

Issue 666133002: Standardize usage of virtual/override/final in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
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 InvalidationService should 5 // This class defines tests that implementations of InvalidationService should
6 // pass in order to be conformant. Here's how you use it to test your 6 // pass in order to be conformant. Here's how you use it to test your
7 // implementation. 7 // implementation.
8 // 8 //
9 // Say your class is called MyInvalidationService. Then you need to define a 9 // Say your class is called MyInvalidationService. Then you need to define a
10 // class called MyInvalidationServiceTestDelegate in 10 // class called MyInvalidationServiceTestDelegate in
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 namespace internal { 333 namespace internal {
334 334
335 // A FakeInvalidationHandler that is "bound" to a specific 335 // A FakeInvalidationHandler that is "bound" to a specific
336 // InvalidationService. This is for cross-referencing state information with 336 // InvalidationService. This is for cross-referencing state information with
337 // the bound InvalidationService. 337 // the bound InvalidationService.
338 class BoundFakeInvalidationHandler : public syncer::FakeInvalidationHandler { 338 class BoundFakeInvalidationHandler : public syncer::FakeInvalidationHandler {
339 public: 339 public:
340 explicit BoundFakeInvalidationHandler( 340 explicit BoundFakeInvalidationHandler(
341 const invalidation::InvalidationService& invalidator); 341 const invalidation::InvalidationService& invalidator);
342 virtual ~BoundFakeInvalidationHandler(); 342 ~BoundFakeInvalidationHandler() override;
343 343
344 // Returns the last return value of GetInvalidatorState() on the 344 // Returns the last return value of GetInvalidatorState() on the
345 // bound invalidator from the last time the invalidator state 345 // bound invalidator from the last time the invalidator state
346 // changed. 346 // changed.
347 syncer::InvalidatorState GetLastRetrievedState() const; 347 syncer::InvalidatorState GetLastRetrievedState() const;
348 348
349 // InvalidationHandler implementation. 349 // InvalidationHandler implementation.
350 virtual void OnInvalidatorStateChange( 350 void OnInvalidatorStateChange(syncer::InvalidatorState state) override;
351 syncer::InvalidatorState state) override;
352 351
353 private: 352 private:
354 const invalidation::InvalidationService& invalidator_; 353 const invalidation::InvalidationService& invalidator_;
355 syncer::InvalidatorState last_retrieved_state_; 354 syncer::InvalidatorState last_retrieved_state_;
356 355
357 DISALLOW_COPY_AND_ASSIGN(BoundFakeInvalidationHandler); 356 DISALLOW_COPY_AND_ASSIGN(BoundFakeInvalidationHandler);
358 }; 357 };
359 358
360 } // namespace internal 359 } // namespace internal
361 360
(...skipping 17 matching lines...) Expand all
379 handler.GetLastRetrievedState()); 378 handler.GetLastRetrievedState());
380 379
381 invalidator->UnregisterInvalidationHandler(&handler); 380 invalidator->UnregisterInvalidationHandler(&handler);
382 } 381 }
383 382
384 REGISTER_TYPED_TEST_CASE_P(InvalidationServiceTest, 383 REGISTER_TYPED_TEST_CASE_P(InvalidationServiceTest,
385 Basic, MultipleHandlers, EmptySetUnregisters, 384 Basic, MultipleHandlers, EmptySetUnregisters,
386 GetInvalidatorStateAlwaysCurrent); 385 GetInvalidatorStateAlwaysCurrent);
387 386
388 #endif // COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_TEST_TEMPLATE_H_ 387 #endif // COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_TEST_TEMPLATE_H_
OLDNEW
« no previous file with comments | « components/invalidation/invalidation_notifier.h ('k') | components/invalidation/invalidator_registrar_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698