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

Unified Diff: webrtc/libjingle/xmpp/util_unittest.h

Issue 2618633003: Revert of Remove webrtc/libjingle/{xmllite,xmpp} (Closed)
Patch Set: Created 3 years, 11 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 | « webrtc/libjingle/xmpp/saslplainmechanism.h ('k') | webrtc/libjingle/xmpp/util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/libjingle/xmpp/util_unittest.h
diff --git a/webrtc/libjingle/xmpp/util_unittest.h b/webrtc/libjingle/xmpp/util_unittest.h
new file mode 100644
index 0000000000000000000000000000000000000000..38009fb4e9146664718914723c2f3acbed792c6b
--- /dev/null
+++ b/webrtc/libjingle/xmpp/util_unittest.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2004 The WebRTC Project Authors. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef WEBRTC_LIBJINGLE_XMPP_UTIL_UNITTEST_H_
+#define WEBRTC_LIBJINGLE_XMPP_UTIL_UNITTEST_H_
+
+#include <sstream>
+#include <string>
+#include "webrtc/libjingle/xmpp/xmppengine.h"
+
+namespace buzz {
+
+// This class captures callbacks from engine.
+class XmppTestHandler : public XmppOutputHandler, public XmppSessionHandler,
+ public XmppStanzaHandler {
+ public:
+ explicit XmppTestHandler(XmppEngine* engine) : engine_(engine) {}
+ virtual ~XmppTestHandler() {}
+
+ void SetEngine(XmppEngine* engine);
+
+ // Output handler
+ virtual void WriteOutput(const char * bytes, size_t len);
+ virtual void StartTls(const std::string & cname);
+ virtual void CloseConnection();
+
+ // Session handler
+ virtual void OnStateChange(int state);
+
+ // Stanza handler
+ virtual bool HandleStanza(const XmlElement* stanza);
+
+ std::string OutputActivity();
+ std::string SessionActivity();
+ std::string StanzaActivity();
+
+ private:
+ XmppEngine* engine_;
+ std::stringstream output_;
+ std::stringstream session_;
+ std::stringstream stanza_;
+};
+
+} // namespace buzz
+
+inline std::ostream& operator<<(std::ostream& os, const buzz::Jid& jid) {
+ os << jid.Str();
+ return os;
+}
+
+#endif // WEBRTC_LIBJINGLE_XMPP_UTIL_UNITTEST_H_
« no previous file with comments | « webrtc/libjingle/xmpp/saslplainmechanism.h ('k') | webrtc/libjingle/xmpp/util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698