server_log_entry_unittest.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef REMOTING_SIGNALING_SERVER_LOG_ENTRY_UNITTEST_H_
  5. #define REMOTING_SIGNALING_SERVER_LOG_ENTRY_UNITTEST_H_
  6. #include <map>
  7. #include <set>
  8. #include <string>
  9. namespace jingle_xmpp {
  10. class XmlElement;
  11. } // namespace jingle_xmpp
  12. namespace remoting {
  13. extern const char kJabberClientNamespace[];
  14. extern const char kChromotingNamespace[];
  15. // Verifies that |stanza| contains a <log> element and returns it. Otherwise
  16. // returns nullptr and records a test failure.
  17. jingle_xmpp::XmlElement* GetLogElementFromStanza(jingle_xmpp::XmlElement* stanza);
  18. // Verifies that |stanza| contains only 1 log entry, and returns the <entry>
  19. // element. Otherwise returns nullptr and records a test failure.
  20. jingle_xmpp::XmlElement* GetSingleLogEntryFromStanza(jingle_xmpp::XmlElement* stanza);
  21. // Verifies a logging stanza.
  22. // |keyValuePairs| lists the keys that must have specified values, and |keys|
  23. // lists the keys that must be present, but may have arbitrary values.
  24. // There must be no other keys.
  25. bool VerifyStanza(
  26. const std::map<std::string, std::string>& key_value_pairs,
  27. const std::set<std::string> keys,
  28. const jingle_xmpp::XmlElement* elem,
  29. std::string* error);
  30. } // namespace remoting
  31. #endif // REMOTING_SIGNALING_SERVER_LOG_ENTRY_UNITTEST_H_