OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/signaling/xmpp_stream_parser.h" | 5 #include "remoting/signaling/xmpp_stream_parser.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" | 14 #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" |
15 | 15 |
16 namespace remoting { | 16 namespace remoting { |
17 | 17 |
18 class XmppStreamParserTest : public testing::Test { | 18 class XmppStreamParserTest : public testing::Test { |
19 public: | 19 public: |
20 XmppStreamParserTest() : error_(false) {} | 20 XmppStreamParserTest() : error_(false) {} |
21 | 21 |
22 void SetUp() override { | 22 void SetUp() override { |
23 parser_.reset(new remoting::XmppStreamParser()); | 23 parser_.reset(new remoting::XmppStreamParser()); |
24 parser_->SetCallbacks( | 24 parser_->SetCallbacks( |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 parser_->AppendData("<stream p!='a'>"); | 87 parser_->AppendData("<stream p!='a'>"); |
88 EXPECT_TRUE(error_); | 88 EXPECT_TRUE(error_); |
89 }; | 89 }; |
90 | 90 |
91 TEST_F(XmppStreamParserTest, FailOnLooseText) { | 91 TEST_F(XmppStreamParserTest, FailOnLooseText) { |
92 parser_->AppendData("stream<"); | 92 parser_->AppendData("stream<"); |
93 EXPECT_TRUE(error_); | 93 EXPECT_TRUE(error_); |
94 }; | 94 }; |
95 | 95 |
96 } // namespace remoting | 96 } // namespace remoting |
OLD | NEW |