Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(807)

Unified Diff: remoting/host/host_change_notification_listener_unittest.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/host_change_notification_listener.h ('k') | remoting/host/host_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/host_change_notification_listener_unittest.cc
diff --git a/remoting/host/host_change_notification_listener_unittest.cc b/remoting/host/host_change_notification_listener_unittest.cc
index bdaff5b51bdb7d8c1956d8f6168717eb39b2b40a..cbacbf9d0ea2c3dfe2a03154f2809a3d739d13d5 100644
--- a/remoting/host/host_change_notification_listener_unittest.cc
+++ b/remoting/host/host_change_notification_listener_unittest.cc
@@ -65,10 +65,10 @@ class HostChangeNotificationListenerTest : public testing::Test {
EXPECT_TRUE(signal_strategy_listeners_.empty());
}
- scoped_ptr<XmlElement> GetNotificationStanza(std::string operation,
- std::string hostId,
- std::string botJid) {
- scoped_ptr<XmlElement> stanza(new XmlElement(buzz::QN_IQ));
+ std::unique_ptr<XmlElement> GetNotificationStanza(std::string operation,
+ std::string hostId,
+ std::string botJid) {
+ std::unique_ptr<XmlElement> stanza(new XmlElement(buzz::QN_IQ));
stanza->AddAttr(QName(std::string(), "type"), "set");
XmlElement* host_changed =
new XmlElement(QName(kChromotingXmlNamespace, "host-changed"));
@@ -84,15 +84,16 @@ class HostChangeNotificationListenerTest : public testing::Test {
MockListener mock_listener_;
MockSignalStrategy signal_strategy_;
std::set<SignalStrategy::Listener*> signal_strategy_listeners_;
- scoped_ptr<HostChangeNotificationListener> host_change_notification_listener_;
+ std::unique_ptr<HostChangeNotificationListener>
+ host_change_notification_listener_;
base::MessageLoop message_loop_;
};
TEST_F(HostChangeNotificationListenerTest, ReceiveValidNotification) {
EXPECT_CALL(mock_listener_, OnHostDeleted())
.WillOnce(Return());
- scoped_ptr<XmlElement> stanza = GetNotificationStanza(
- "delete", kHostId, kTestBotJid);
+ std::unique_ptr<XmlElement> stanza =
+ GetNotificationStanza("delete", kHostId, kTestBotJid);
host_change_notification_listener_->OnSignalStrategyIncomingStanza(
stanza.get());
message_loop_.PostTask(FROM_HERE,
@@ -103,8 +104,8 @@ TEST_F(HostChangeNotificationListenerTest, ReceiveValidNotification) {
TEST_F(HostChangeNotificationListenerTest, ReceiveNotificationBeforeDelete) {
EXPECT_CALL(mock_listener_, OnHostDeleted())
.Times(0);
- scoped_ptr<XmlElement> stanza = GetNotificationStanza(
- "delete", kHostId, kTestBotJid);
+ std::unique_ptr<XmlElement> stanza =
+ GetNotificationStanza("delete", kHostId, kTestBotJid);
host_change_notification_listener_->OnSignalStrategyIncomingStanza(
stanza.get());
host_change_notification_listener_.reset();
@@ -117,8 +118,8 @@ TEST_F(HostChangeNotificationListenerTest, ReceiveNotificationBeforeDelete) {
TEST_F(HostChangeNotificationListenerTest, ReceiveInvalidHostIdNotification) {
EXPECT_CALL(mock_listener_, OnHostDeleted())
.Times(0);
- scoped_ptr<XmlElement> stanza = GetNotificationStanza(
- "delete", "1", kTestBotJid);
+ std::unique_ptr<XmlElement> stanza =
+ GetNotificationStanza("delete", "1", kTestBotJid);
host_change_notification_listener_->OnSignalStrategyIncomingStanza(
stanza.get());
message_loop_.PostTask(FROM_HERE,
@@ -129,7 +130,7 @@ TEST_F(HostChangeNotificationListenerTest, ReceiveInvalidHostIdNotification) {
TEST_F(HostChangeNotificationListenerTest, ReceiveInvalidBotJidNotification) {
EXPECT_CALL(mock_listener_, OnHostDeleted())
.Times(0);
- scoped_ptr<XmlElement> stanza = GetNotificationStanza(
+ std::unique_ptr<XmlElement> stanza = GetNotificationStanza(
"delete", kHostId, "notremotingbot@bot.talk.google.com");
host_change_notification_listener_->OnSignalStrategyIncomingStanza(
stanza.get());
@@ -141,8 +142,8 @@ TEST_F(HostChangeNotificationListenerTest, ReceiveInvalidBotJidNotification) {
TEST_F(HostChangeNotificationListenerTest, ReceiveNonDeleteNotification) {
EXPECT_CALL(mock_listener_, OnHostDeleted())
.Times(0);
- scoped_ptr<XmlElement> stanza = GetNotificationStanza(
- "update", kHostId, kTestBotJid);
+ std::unique_ptr<XmlElement> stanza =
+ GetNotificationStanza("update", kHostId, kTestBotJid);
host_change_notification_listener_->OnSignalStrategyIncomingStanza(
stanza.get());
message_loop_.PostTask(FROM_HERE,
« no previous file with comments | « remoting/host/host_change_notification_listener.h ('k') | remoting/host/host_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698