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

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

Issue 10916131: [Invalidations] Add GetInvalidatorState() to Invalidator{,Frontend} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android Created 8 years, 3 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 "sync/notifier/non_blocking_invalidator.h" 5 #include "sync/notifier/non_blocking_invalidator.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 void WaitForInvalidator() { 69 void WaitForInvalidator() {
70 base::RunLoop run_loop; 70 base::RunLoop run_loop;
71 ASSERT_TRUE( 71 ASSERT_TRUE(
72 io_thread_.message_loop_proxy()->PostTaskAndReply( 72 io_thread_.message_loop_proxy()->PostTaskAndReply(
73 FROM_HERE, 73 FROM_HERE,
74 base::Bind(&DoNothing), 74 base::Bind(&DoNothing),
75 run_loop.QuitClosure())); 75 run_loop.QuitClosure()));
76 run_loop.Run(); 76 run_loop.Run();
77 } 77 }
78 78
79 void TriggerOnNotificationsEnabled() { 79 void TriggerOnInvalidatorStateChange(InvalidatorState state) {
80 invalidator_->OnNotificationsEnabled(); 80 invalidator_->OnInvalidatorStateChange(state);
81 } 81 }
82 82
83 void TriggerOnIncomingNotification(const ObjectIdStateMap& id_state_map, 83 void TriggerOnIncomingInvalidation(const ObjectIdStateMap& id_state_map,
84 IncomingNotificationSource source) { 84 IncomingInvalidationSource source) {
85 invalidator_->OnIncomingNotification(id_state_map, source); 85 invalidator_->OnIncomingInvalidation(id_state_map, source);
86 }
87
88 void TriggerOnNotificationsDisabled(NotificationsDisabledReason reason) {
89 invalidator_->OnNotificationsDisabled(reason);
90 } 86 }
91 87
92 static bool InvalidatorHandlesDeprecatedState() { 88 static bool InvalidatorHandlesDeprecatedState() {
93 return true; 89 return true;
94 } 90 }
95 91
96 private: 92 private:
97 MessageLoop message_loop_; 93 MessageLoop message_loop_;
98 base::Thread io_thread_; 94 base::Thread io_thread_;
99 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; 95 scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
100 scoped_ptr<NonBlockingInvalidator> invalidator_; 96 scoped_ptr<NonBlockingInvalidator> invalidator_;
101 }; 97 };
102 98
103 INSTANTIATE_TYPED_TEST_CASE_P( 99 INSTANTIATE_TYPED_TEST_CASE_P(
104 NonBlockingInvalidatorTest, InvalidatorTest, 100 NonBlockingInvalidatorTest, InvalidatorTest,
105 NonBlockingInvalidatorTestDelegate); 101 NonBlockingInvalidatorTestDelegate);
106 102
107 } // namespace 103 } // namespace
108 104
109 } // namespace syncer 105 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/notifier/non_blocking_invalidator.cc ('k') | sync/notifier/notifications_disabled_reason.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698