| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include <iostream> | 11 #include <iostream> |
| 12 #include <memory> |
| 12 #include <sstream> | 13 #include <sstream> |
| 13 #include <string> | 14 #include <string> |
| 15 |
| 14 #include "webrtc/libjingle/xmllite/xmlelement.h" | 16 #include "webrtc/libjingle/xmllite/xmlelement.h" |
| 15 #include "webrtc/libjingle/xmpp/constants.h" | 17 #include "webrtc/libjingle/xmpp/constants.h" |
| 16 #include "webrtc/libjingle/xmpp/plainsaslhandler.h" | 18 #include "webrtc/libjingle/xmpp/plainsaslhandler.h" |
| 17 #include "webrtc/libjingle/xmpp/saslplainmechanism.h" | 19 #include "webrtc/libjingle/xmpp/saslplainmechanism.h" |
| 18 #include "webrtc/libjingle/xmpp/util_unittest.h" | 20 #include "webrtc/libjingle/xmpp/util_unittest.h" |
| 19 #include "webrtc/libjingle/xmpp/xmppengine.h" | 21 #include "webrtc/libjingle/xmpp/xmppengine.h" |
| 20 #include "webrtc/base/common.h" | 22 #include "webrtc/base/common.h" |
| 21 #include "webrtc/base/cryptstring.h" | 23 #include "webrtc/base/cryptstring.h" |
| 22 #include "webrtc/base/gunit.h" | 24 #include "webrtc/base/gunit.h" |
| 23 | 25 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 new buzz::PlainSaslHandler(jid, rtc::CryptString(pass), true)); | 62 new buzz::PlainSaslHandler(jid, rtc::CryptString(pass), true)); |
| 61 } | 63 } |
| 62 virtual void TearDown() { | 64 virtual void TearDown() { |
| 63 handler_.reset(); | 65 handler_.reset(); |
| 64 engine_.reset(); | 66 engine_.reset(); |
| 65 } | 67 } |
| 66 void RunPartialLogin(XlttStage startstage, XlttStage endstage); | 68 void RunPartialLogin(XlttStage startstage, XlttStage endstage); |
| 67 void SetTlsOptions(buzz::TlsOptions option); | 69 void SetTlsOptions(buzz::TlsOptions option); |
| 68 | 70 |
| 69 private: | 71 private: |
| 70 rtc::scoped_ptr<XmppEngine> engine_; | 72 std::unique_ptr<XmppEngine> engine_; |
| 71 rtc::scoped_ptr<XmppTestHandler> handler_; | 73 std::unique_ptr<XmppTestHandler> handler_; |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 void XmppLoginTaskTest::SetTlsOptions(buzz::TlsOptions option) { | 76 void XmppLoginTaskTest::SetTlsOptions(buzz::TlsOptions option) { |
| 75 engine_->SetTls(option); | 77 engine_->SetTls(option); |
| 76 } | 78 } |
| 77 void XmppLoginTaskTest::RunPartialLogin(XlttStage startstage, | 79 void XmppLoginTaskTest::RunPartialLogin(XlttStage startstage, |
| 78 XlttStage endstage) { | 80 XlttStage endstage) { |
| 79 std::string input; | 81 std::string input; |
| 80 | 82 |
| 81 switch (startstage) { | 83 switch (startstage) { |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 "Some special application diagnostic information!" | 627 "Some special application diagnostic information!" |
| 626 "</text>" | 628 "</text>" |
| 627 "<escape-your-data xmlns=\"application-ns\"/>" | 629 "<escape-your-data xmlns=\"application-ns\"/>" |
| 628 "</str:error>", engine()->GetStreamError()->Str()); | 630 "</str:error>", engine()->GetStreamError()->Str()); |
| 629 | 631 |
| 630 TearDown(); | 632 TearDown(); |
| 631 SetUp(); | 633 SetUp(); |
| 632 } | 634 } |
| 633 } | 635 } |
| 634 | 636 |
| OLD | NEW |