| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/protocol/jingle_messages.h" | 5 #include "remoting/protocol/jingle_messages.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" | 10 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 XmlElement::ForStr(kTestIceTransportInfoMessage)); | 244 XmlElement::ForStr(kTestIceTransportInfoMessage)); |
| 245 ASSERT_TRUE(source_message.get()); | 245 ASSERT_TRUE(source_message.get()); |
| 246 | 246 |
| 247 EXPECT_TRUE(JingleMessage::IsJingleMessage(source_message.get())); | 247 EXPECT_TRUE(JingleMessage::IsJingleMessage(source_message.get())); |
| 248 | 248 |
| 249 JingleMessage message; | 249 JingleMessage message; |
| 250 std::string error; | 250 std::string error; |
| 251 EXPECT_TRUE(message.ParseXml(source_message.get(), &error)) << error; | 251 EXPECT_TRUE(message.ParseXml(source_message.get(), &error)) << error; |
| 252 | 252 |
| 253 EXPECT_EQ(message.action, JingleMessage::TRANSPORT_INFO); | 253 EXPECT_EQ(message.action, JingleMessage::TRANSPORT_INFO); |
| 254 | 254 EXPECT_EQ(message.candidates.size(), 2U); |
| 255 IceTransportInfo transport_info; | |
| 256 EXPECT_TRUE(transport_info.ParseXml(message.transport_info.get())); | |
| 257 EXPECT_EQ(transport_info.ice_credentials.size(), 2U); | |
| 258 EXPECT_EQ(transport_info.candidates.size(), 2U); | |
| 259 | 255 |
| 260 scoped_ptr<XmlElement> formatted_message(message.ToXml()); | 256 scoped_ptr<XmlElement> formatted_message(message.ToXml()); |
| 261 ASSERT_TRUE(formatted_message.get()); | 257 ASSERT_TRUE(formatted_message.get()); |
| 262 EXPECT_TRUE(VerifyXml(source_message.get(), formatted_message.get(), &error)) | 258 EXPECT_TRUE(VerifyXml(source_message.get(), formatted_message.get(), &error)) |
| 263 << error; | 259 << error; |
| 264 } | 260 } |
| 265 | 261 |
| 266 TEST(JingleMessageTest, SessionTerminate) { | 262 TEST(JingleMessageTest, SessionTerminate) { |
| 267 const char* kTestSessionTerminateMessage = | 263 const char* kTestSessionTerminateMessage = |
| 268 "<cli:iq from='user@gmail.com/chromoting016DBB07' " | 264 "<cli:iq from='user@gmail.com/chromoting016DBB07' " |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 EXPECT_FALSE(JingleMessage::IsJingleMessage(source_message.get())); | 412 EXPECT_FALSE(JingleMessage::IsJingleMessage(source_message.get())); |
| 417 | 413 |
| 418 JingleMessage message; | 414 JingleMessage message; |
| 419 std::string error; | 415 std::string error; |
| 420 EXPECT_FALSE(message.ParseXml(source_message.get(), &error)); | 416 EXPECT_FALSE(message.ParseXml(source_message.get(), &error)); |
| 421 EXPECT_FALSE(error.empty()); | 417 EXPECT_FALSE(error.empty()); |
| 422 } | 418 } |
| 423 | 419 |
| 424 } // namespace protocol | 420 } // namespace protocol |
| 425 } // namespace remoting | 421 } // namespace remoting |
| OLD | NEW |