summaryrefslogtreecommitdiffstats
path: root/jingle/notifier/base
diff options
context:
space:
mode:
authorghc@google.com <ghc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-27 00:40:21 +0000
committerghc@google.com <ghc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-27 00:40:21 +0000
commit6f765db725292f9eb8349afc004c933f5cffa352 (patch)
treeeb70892adbd652b07593b1d19f119904ef3504e3 /jingle/notifier/base
parent449a7fcf7a00939468e8de7f1889db9b9d7be49f (diff)
downloadchromium_src-6f765db725292f9eb8349afc004c933f5cffa352.zip
chromium_src-6f765db725292f9eb8349afc004c933f5cffa352.tar.gz
chromium_src-6f765db725292f9eb8349afc004c933f5cffa352.tar.bz2
- replace custom <iq>-stanza protocol with push notifications (using PushNotifications* classes) in CacheInvalidationPacketHandler, and update unit test accordingly
- extend notifier::Notification and PushNotificationsSendUpdateTask to allow specification of recipients (and recipient-specific data) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=119171 Review URL: http://codereview.chromium.org/9190029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle/notifier/base')
-rw-r--r--jingle/notifier/base/fake_base_task.cc33
1 files changed, 30 insertions, 3 deletions
diff --git a/jingle/notifier/base/fake_base_task.cc b/jingle/notifier/base/fake_base_task.cc
index 9dceec0..f3d64ca 100644
--- a/jingle/notifier/base/fake_base_task.cc
+++ b/jingle/notifier/base/fake_base_task.cc
@@ -1,7 +1,8 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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 "jingle/notifier/base/fake_base_task.h"
#include "jingle/notifier/base/weak_xmpp_client.h"
#include "talk/xmpp/asyncsocket.h"
@@ -26,10 +27,36 @@ class MockAsyncSocket : public buzz::AsyncSocket {
MOCK_METHOD1(StartTls, bool(const std::string&));
};
+} // namespace notifier
+
+namespace {
+
+// Extends WeakXmppClient to make jid() return a full jid, as required by
+// PushNotificationsSubscribeTask.
+class FakeWeakXmppClient : public notifier::WeakXmppClient {
+ public:
+ explicit FakeWeakXmppClient(talk_base::TaskParent* parent)
+ : notifier::WeakXmppClient(parent),
+ jid_("test@example.com/testresource") {}
+
+ virtual ~FakeWeakXmppClient() {}
+
+ virtual const buzz::Jid& jid() const OVERRIDE {
+ return jid_;
+ }
+
+ private:
+ buzz::Jid jid_;
+};
+
+} // namespace
+
+namespace notifier {
+
FakeBaseTask::FakeBaseTask() {
// Owned by |task_pump_|.
- notifier::WeakXmppClient* weak_xmpp_client =
- new notifier::WeakXmppClient(&task_pump_);
+ FakeWeakXmppClient* weak_xmpp_client =
+ new FakeWeakXmppClient(&task_pump_);
weak_xmpp_client->Start();
buzz::XmppClientSettings settings;