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

Side by Side Diff: third_party/libjingle_xmpp/xmpp/util_unittest.h

Issue 2443903004: Add xmllite and xmpp sources to third_party/ (Closed)
Patch Set: Explicitly use webrtc_overrides/webrtc/base/logging.h 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_LIBJINGLE_XMPP_UTIL_UNITTEST_H_
12 #define WEBRTC_LIBJINGLE_XMPP_UTIL_UNITTEST_H_
13
14 #include <sstream>
15 #include <string>
16 #include "third_party/libjingle_xmpp/xmpp/xmppengine.h"
17
18 namespace buzz {
19
20 // This class captures callbacks from engine.
21 class XmppTestHandler : public XmppOutputHandler, public XmppSessionHandler,
22 public XmppStanzaHandler {
23 public:
24 explicit XmppTestHandler(XmppEngine* engine) : engine_(engine) {}
25 virtual ~XmppTestHandler() {}
26
27 void SetEngine(XmppEngine* engine);
28
29 // Output handler
30 virtual void WriteOutput(const char * bytes, size_t len);
31 virtual void StartTls(const std::string & cname);
32 virtual void CloseConnection();
33
34 // Session handler
35 virtual void OnStateChange(int state);
36
37 // Stanza handler
38 virtual bool HandleStanza(const XmlElement* stanza);
39
40 std::string OutputActivity();
41 std::string SessionActivity();
42 std::string StanzaActivity();
43
44 private:
45 XmppEngine* engine_;
46 std::stringstream output_;
47 std::stringstream session_;
48 std::stringstream stanza_;
49 };
50
51 } // namespace buzz
52
53 inline std::ostream& operator<<(std::ostream& os, const buzz::Jid& jid) {
54 os << jid.Str();
55 return os;
56 }
57
58 #endif // WEBRTC_LIBJINGLE_XMPP_UTIL_UNITTEST_H_
OLDNEW
« no previous file with comments | « third_party/libjingle_xmpp/xmpp/saslplainmechanism.h ('k') | third_party/libjingle_xmpp/xmpp/util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698