OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/host/host_change_notification_listener.h" | 5 #include "remoting/host/host_change_notification_listener.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 virtual void TearDown() OVERRIDE { | 63 virtual void TearDown() OVERRIDE { |
64 host_change_notification_listener_.reset(); | 64 host_change_notification_listener_.reset(); |
65 EXPECT_TRUE(signal_strategy_listeners_.empty()); | 65 EXPECT_TRUE(signal_strategy_listeners_.empty()); |
66 } | 66 } |
67 | 67 |
68 scoped_ptr<XmlElement> GetNotificationStanza(std::string operation, | 68 scoped_ptr<XmlElement> GetNotificationStanza(std::string operation, |
69 std::string hostId, | 69 std::string hostId, |
70 std::string botJid) { | 70 std::string botJid) { |
71 scoped_ptr<XmlElement> stanza(new XmlElement(buzz::QN_IQ)); | 71 scoped_ptr<XmlElement> stanza(new XmlElement(buzz::QN_IQ)); |
72 stanza->AddAttr(QName("", "type"), "set"); | 72 stanza->AddAttr(QName(std::string(), "type"), "set"); |
73 XmlElement* host_changed = new XmlElement( | 73 XmlElement* host_changed = |
74 QName(kChromotingXmlNamespace, "host-changed")); | 74 new XmlElement(QName(kChromotingXmlNamespace, "host-changed")); |
75 host_changed->AddAttr(QName(kChromotingXmlNamespace, "operation"), | 75 host_changed->AddAttr(QName(kChromotingXmlNamespace, "operation"), |
76 operation); | 76 operation); |
77 host_changed->AddAttr(QName(kChromotingXmlNamespace, "hostid"), hostId); | 77 host_changed->AddAttr(QName(kChromotingXmlNamespace, "hostid"), hostId); |
78 stanza->AddElement(host_changed); | 78 stanza->AddElement(host_changed); |
79 stanza->AddAttr(buzz::QN_FROM, botJid); | 79 stanza->AddAttr(buzz::QN_FROM, botJid); |
80 stanza->AddAttr(buzz::QN_TO, kTestJid); | 80 stanza->AddAttr(buzz::QN_TO, kTestJid); |
81 return stanza.Pass(); | 81 return stanza.Pass(); |
82 } | 82 } |
83 | 83 |
84 MockListener mock_listener_; | 84 MockListener mock_listener_; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 .Times(0); | 139 .Times(0); |
140 scoped_ptr<XmlElement> stanza = GetNotificationStanza( | 140 scoped_ptr<XmlElement> stanza = GetNotificationStanza( |
141 "update", kHostId, kTestBotJid); | 141 "update", kHostId, kTestBotJid); |
142 host_change_notification_listener_->OnSignalStrategyIncomingStanza( | 142 host_change_notification_listener_->OnSignalStrategyIncomingStanza( |
143 stanza.get()); | 143 stanza.get()); |
144 message_loop_.PostTask(FROM_HERE, base::Bind(MessageLoop::QuitClosure())); | 144 message_loop_.PostTask(FROM_HERE, base::Bind(MessageLoop::QuitClosure())); |
145 message_loop_.Run(); | 145 message_loop_.Run(); |
146 } | 146 } |
147 | 147 |
148 } // namespace remoting | 148 } // namespace remoting |
OLD | NEW |