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

Unified Diff: remoting/signaling/xmpp_signal_strategy_unittest.cc

Issue 2253233004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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/signaling/server_log_entry.cc ('k') | remoting/test/fake_port_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/signaling/xmpp_signal_strategy_unittest.cc
diff --git a/remoting/signaling/xmpp_signal_strategy_unittest.cc b/remoting/signaling/xmpp_signal_strategy_unittest.cc
index ad4fe35ee86874e3fe578cf7dc46223bbcdbca5d..e991ec014faab90c28202bcaa6e4d364880ab124 100644
--- a/remoting/signaling/xmpp_signal_strategy_unittest.cc
+++ b/remoting/signaling/xmpp_signal_strategy_unittest.cc
@@ -120,7 +120,7 @@ class XmppSignalStrategyTest : public testing::Test,
void SetUp() override {
request_context_getter_ = new net::TestURLRequestContextGetter(
message_loop_.task_runner(),
- base::WrapUnique(new net::TestURLRequestContext()));
+ base::MakeUnique<net::TestURLRequestContext>());
}
void CreateSignalStrategy(int port) {
@@ -145,8 +145,7 @@ class XmppSignalStrategyTest : public testing::Test,
}
bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override {
- received_messages_.push_back(
- base::WrapUnique(new buzz::XmlElement(*stanza)));
+ received_messages_.push_back(base::MakeUnique<buzz::XmlElement>(*stanza));
return true;
}
@@ -273,8 +272,8 @@ TEST_F(XmppSignalStrategyTest, SendAndReceive) {
CreateSignalStrategy(kDefaultPort);
Connect(true);
- EXPECT_TRUE(signal_strategy_->SendStanza(base::WrapUnique(
- new buzz::XmlElement(buzz::QName(std::string(), "hello")))));
+ EXPECT_TRUE(signal_strategy_->SendStanza(
+ base::MakeUnique<buzz::XmlElement>(buzz::QName(std::string(), "hello"))));
EXPECT_EQ("<hello/>", socket_data_provider_->GetAndClearWrittenData());
socket_data_provider_->ReceiveData("<hi xmlns=\"hello\"/>");
@@ -299,8 +298,8 @@ TEST_F(XmppSignalStrategyTest, ConnectionClosed) {
EXPECT_EQ(SignalStrategy::OK, signal_strategy_->GetError());
// Can't send messages anymore.
- EXPECT_FALSE(signal_strategy_->SendStanza(base::WrapUnique(
- new buzz::XmlElement(buzz::QName(std::string(), "hello")))));
+ EXPECT_FALSE(signal_strategy_->SendStanza(
+ base::MakeUnique<buzz::XmlElement>(buzz::QName(std::string(), "hello"))));
// Try connecting again.
Connect(true);
@@ -317,8 +316,8 @@ TEST_F(XmppSignalStrategyTest, NetworkReadError) {
EXPECT_EQ(SignalStrategy::NETWORK_ERROR, signal_strategy_->GetError());
// Can't send messages anymore.
- EXPECT_FALSE(signal_strategy_->SendStanza(base::WrapUnique(
- new buzz::XmlElement(buzz::QName(std::string(), "hello")))));
+ EXPECT_FALSE(signal_strategy_->SendStanza(
+ base::MakeUnique<buzz::XmlElement>(buzz::QName(std::string(), "hello"))));
// Try connecting again.
Connect(true);
@@ -331,8 +330,8 @@ TEST_F(XmppSignalStrategyTest, NetworkWriteError) {
socket_data_provider_->set_write_error(net::ERR_FAILED);
// Next SendMessage() will call Write() which will fail.
- EXPECT_FALSE(signal_strategy_->SendStanza(base::WrapUnique(
- new buzz::XmlElement(buzz::QName(std::string(), "hello")))));
+ EXPECT_FALSE(signal_strategy_->SendStanza(
+ base::MakeUnique<buzz::XmlElement>(buzz::QName(std::string(), "hello"))));
EXPECT_EQ(3U, state_history_.size());
EXPECT_EQ(SignalStrategy::DISCONNECTED, state_history_[2]);
« no previous file with comments | « remoting/signaling/server_log_entry.cc ('k') | remoting/test/fake_port_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698