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

Unified Diff: sync/notifier/fake_invalidator_unittest.cc

Issue 308413002: Revert of Move some sync/notifier to components/invalidation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/notifier/fake_invalidator.cc ('k') | sync/notifier/gcm_network_channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/fake_invalidator_unittest.cc
diff --git a/sync/notifier/fake_invalidator_unittest.cc b/sync/notifier/fake_invalidator_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d8cae840b25565b68f426ba167f37ae98e1841e0
--- /dev/null
+++ b/sync/notifier/fake_invalidator_unittest.cc
@@ -0,0 +1,63 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "sync/notifier/fake_invalidator.h"
+#include "sync/notifier/invalidator_test_template.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace syncer {
+
+namespace {
+
+class FakeInvalidatorTestDelegate {
+ public:
+ FakeInvalidatorTestDelegate() {}
+
+ ~FakeInvalidatorTestDelegate() {
+ DestroyInvalidator();
+ }
+
+ void CreateInvalidator(
+ const std::string& invalidator_client_id,
+ const std::string& initial_state,
+ const base::WeakPtr<InvalidationStateTracker>&
+ invalidation_state_tracker) {
+ DCHECK(!invalidator_.get());
+ invalidator_.reset(new FakeInvalidator());
+ }
+
+ FakeInvalidator* GetInvalidator() {
+ return invalidator_.get();
+ }
+
+ void DestroyInvalidator() {
+ invalidator_.reset();
+ }
+
+ void WaitForInvalidator() {
+ // Do Nothing.
+ }
+
+ void TriggerOnInvalidatorStateChange(InvalidatorState state) {
+ invalidator_->EmitOnInvalidatorStateChange(state);
+ }
+
+ void TriggerOnIncomingInvalidation(
+ const ObjectIdInvalidationMap& invalidation_map) {
+ invalidator_->EmitOnIncomingInvalidation(invalidation_map);
+ }
+
+ private:
+ scoped_ptr<FakeInvalidator> invalidator_;
+};
+
+INSTANTIATE_TYPED_TEST_CASE_P(
+ FakeInvalidatorTest, InvalidatorTest,
+ FakeInvalidatorTestDelegate);
+
+} // namespace
+
+} // namespace syncer
« 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