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

Unified Diff: chrome/browser/sync/notifier/listener/subscribe_task_unittest.cc

Issue 1956001: Moved XMPP notifier library from chrome/browser/sync to chrome/common.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 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
Index: chrome/browser/sync/notifier/listener/subscribe_task_unittest.cc
===================================================================
--- chrome/browser/sync/notifier/listener/subscribe_task_unittest.cc (revision 46353)
+++ chrome/browser/sync/notifier/listener/subscribe_task_unittest.cc (working copy)
@@ -1,74 +0,0 @@
-// Copyright (c) 2010 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 "chrome/browser/sync/notifier/listener/subscribe_task.h"
-
-#include "base/logging.h"
-#include "base/scoped_ptr.h"
-#include "base/string_util.h"
-#include "chrome/browser/sync/notification_method.h"
-#include "chrome/browser/sync/notifier/listener/xml_element_util.h"
-#include "talk/xmpp/jid.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace buzz {
-class XmlElement;
-}
-
-namespace notifier {
-
-class SubscribeTaskTest : public testing::Test {
- public:
- SubscribeTaskTest() : to_jid_bare_("to@jid.com"), task_id_("taskid") {
- EXPECT_EQ(to_jid_bare_.Str(), to_jid_bare_.BareJid().Str());
- }
-
- protected:
- const buzz::Jid to_jid_bare_;
- const std::string task_id_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SubscribeTaskTest);
-};
-
-TEST_F(SubscribeTaskTest, MakeSubscriptionMessage) {
- std::vector<std::string> subscribed_services_list;
- scoped_ptr<buzz::XmlElement> message_without_services(
- SubscribeTask::MakeSubscriptionMessage(subscribed_services_list,
- to_jid_bare_, task_id_));
- std::string expected_xml_string =
- StringPrintf(
- "<cli:iq type=\"get\" to=\"%s\" id=\"%s\" "
- "xmlns:cli=\"jabber:client\">"
- "<getAll xmlns=\"google:notifier\">"
- "<ClientActive xmlns=\"\" bool=\"true\"/>"
- "</getAll>"
- "</cli:iq>",
- to_jid_bare_.Str().c_str(), task_id_.c_str());
- EXPECT_EQ(expected_xml_string, XmlElementToString(*message_without_services));
-
- subscribed_services_list.push_back("test_service_url1");
- subscribed_services_list.push_back("test_service_url2");
- scoped_ptr<buzz::XmlElement> message_with_services(
- SubscribeTask::MakeSubscriptionMessage(subscribed_services_list,
- to_jid_bare_, task_id_));
- expected_xml_string =
- StringPrintf(
- "<cli:iq type=\"get\" to=\"%s\" id=\"%s\" "
- "xmlns:cli=\"jabber:client\">"
- "<getAll xmlns=\"google:notifier\">"
- "<ClientActive xmlns=\"\" bool=\"true\"/>"
- "<SubscribedServiceUrl "
- "xmlns=\"\" data=\"test_service_url1\"/>"
- "<SubscribedServiceUrl "
- "xmlns=\"\" data=\"test_service_url2\"/>"
- "<FilterNonSubscribed xmlns=\"\" bool=\"true\"/>"
- "</getAll>"
- "</cli:iq>",
- to_jid_bare_.Str().c_str(), task_id_.c_str());
-
- EXPECT_EQ(expected_xml_string, XmlElementToString(*message_with_services));
-}
-
-} // namespace notifier
« no previous file with comments | « chrome/browser/sync/notifier/listener/subscribe_task.cc ('k') | chrome/browser/sync/notifier/listener/talk_mediator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698