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

Unified Diff: sync/notifier/cache_invalidation_packet_handler_unittest.cc

Issue 10436013: [Sync] Make InvalidationNotifier use PushClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head Created 8 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/cache_invalidation_packet_handler.cc ('k') | sync/notifier/chrome_invalidation_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/cache_invalidation_packet_handler_unittest.cc
diff --git a/sync/notifier/cache_invalidation_packet_handler_unittest.cc b/sync/notifier/cache_invalidation_packet_handler_unittest.cc
deleted file mode 100644
index 184c030c8797ef8e7e6f4cad3dba7883487fd54c..0000000000000000000000000000000000000000
--- a/sync/notifier/cache_invalidation_packet_handler_unittest.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-// 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 "sync/notifier/cache_invalidation_packet_handler.h"
-
-#include "base/base64.h"
-#include "base/memory/weak_ptr.h"
-#include "base/message_loop.h"
-#include "google/cacheinvalidation/deps/callback.h"
-#include "google/cacheinvalidation/include/system-resources.h"
-#include "google/cacheinvalidation/v2/client_gateway.pb.h"
-#include "jingle/notifier/base/fake_base_task.h"
-#include "jingle/notifier/listener/notification_defines.h"
-#include "talk/base/task.h"
-#include "talk/xmpp/asyncsocket.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace sync_notifier {
-
-class MockMessageCallback {
- public:
- void StoreMessage(const std::string& message) {
- last_message = message;
- }
-
- std::string last_message;
-};
-
-class CacheInvalidationPacketHandlerTest : public testing::Test {
- public:
- virtual ~CacheInvalidationPacketHandlerTest() {}
-
- notifier::Notification MakeNotification(const std::string& data) {
- notifier::Notification notification;
- notification.channel = "tango_raw";
- notification.data = data;
- return notification;
- }
-};
-
-TEST_F(CacheInvalidationPacketHandlerTest, Basic) {
- MessageLoop message_loop;
-
- notifier::FakeBaseTask fake_base_task;
-
- std::string last_message;
- MockMessageCallback callback;
- invalidation::MessageCallback* mock_message_callback =
- invalidation::NewPermanentCallback(
- &callback, &MockMessageCallback::StoreMessage);
-
- const char kInboundMessage[] = "non-bogus";
- ipc::invalidation::ClientGatewayMessage envelope;
- envelope.set_network_message(kInboundMessage);
- std::string serialized;
- envelope.SerializeToString(&serialized);
- {
- CacheInvalidationPacketHandler handler(fake_base_task.AsWeakPtr());
- handler.SetMessageReceiver(mock_message_callback);
-
- // Take care of any tasks posted by the constructor.
- message_loop.RunAllPending();
-
- {
- handler.OnNotificationReceived(MakeNotification("bogus"));
- handler.OnNotificationReceived(MakeNotification(serialized));
- }
-
- // Take care of any tasks posted by HandleOutboundPacket().
- message_loop.RunAllPending();
-
- EXPECT_EQ(callback.last_message, kInboundMessage);
- }
-}
-
-} // namespace sync_notifier
« no previous file with comments | « sync/notifier/cache_invalidation_packet_handler.cc ('k') | sync/notifier/chrome_invalidation_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698