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

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

Issue 294123004: Move some sync/notifier to components/invalidation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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
« no previous file with comments | « sync/notifier/fake_invalidator.cc ('k') | sync/notifier/gcm_network_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/compiler_specific.h"
6 #include "base/memory/scoped_ptr.h"
7 #include "sync/notifier/fake_invalidator.h"
8 #include "sync/notifier/invalidator_test_template.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace syncer {
12
13 namespace {
14
15 class FakeInvalidatorTestDelegate {
16 public:
17 FakeInvalidatorTestDelegate() {}
18
19 ~FakeInvalidatorTestDelegate() {
20 DestroyInvalidator();
21 }
22
23 void CreateInvalidator(
24 const std::string& invalidator_client_id,
25 const std::string& initial_state,
26 const base::WeakPtr<InvalidationStateTracker>&
27 invalidation_state_tracker) {
28 DCHECK(!invalidator_.get());
29 invalidator_.reset(new FakeInvalidator());
30 }
31
32 FakeInvalidator* GetInvalidator() {
33 return invalidator_.get();
34 }
35
36 void DestroyInvalidator() {
37 invalidator_.reset();
38 }
39
40 void WaitForInvalidator() {
41 // Do Nothing.
42 }
43
44 void TriggerOnInvalidatorStateChange(InvalidatorState state) {
45 invalidator_->EmitOnInvalidatorStateChange(state);
46 }
47
48 void TriggerOnIncomingInvalidation(
49 const ObjectIdInvalidationMap& invalidation_map) {
50 invalidator_->EmitOnIncomingInvalidation(invalidation_map);
51 }
52
53 private:
54 scoped_ptr<FakeInvalidator> invalidator_;
55 };
56
57 INSTANTIATE_TYPED_TEST_CASE_P(
58 FakeInvalidatorTest, InvalidatorTest,
59 FakeInvalidatorTestDelegate);
60
61 } // namespace
62
63 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/notifier/fake_invalidator.cc ('k') | sync/notifier/gcm_network_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698