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

Unified Diff: sync/notifier/gcm_network_channel_unittest.cc

Issue 116533006: Control invalidations network channel from TiclInvalidationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years 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
Index: sync/notifier/gcm_network_channel_unittest.cc
diff --git a/sync/notifier/gcm_network_channel_unittest.cc b/sync/notifier/gcm_network_channel_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a350e3f635a4752b1524dfb3a0d6a282b5afd14e
--- /dev/null
+++ b/sync/notifier/gcm_network_channel_unittest.cc
@@ -0,0 +1,41 @@
+// Copyright 2013 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 "sync/notifier/gcm_network_channel.h"
+
+#include "base/compiler_specific.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace syncer {
+namespace {
+
+class GCMNetworkChannelTest
+ : public ::testing::Test,
+ public SyncNetworkChannel::Observer {
+ protected:
+ GCMNetworkChannelTest()
+ : gcm_network_channel_(),
+ last_invalidator_state_(DEFAULT_INVALIDATION_ERROR) {
+ gcm_network_channel_.AddObserver(this);
+ gcm_network_channel_.SetMessageReceiver(
+ invalidation::NewPermanentCallback(
+ this, &GCMNetworkChannelTest::OnIncomingMessage));
+ }
+
+ virtual ~GCMNetworkChannelTest() {
+ gcm_network_channel_.RemoveObserver(this);
+ }
+
+ virtual void OnNetworkChannelStateChanged(
+ InvalidatorState invalidator_state) OVERRIDE {
+ }
+
+ void OnIncomingMessage(std::string incoming_message) {
+ }
+
+ GCMNetworkChannel gcm_network_channel_;
+};
+
+} // namespace
+} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698