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

Unified Diff: extensions/browser/api/cast_channel/logger_unittest.cc

Issue 1902873002: Convert //extensions/browser/api from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: extensions/browser/api/cast_channel/logger_unittest.cc
diff --git a/extensions/browser/api/cast_channel/logger_unittest.cc b/extensions/browser/api/cast_channel/logger_unittest.cc
index a9daf7bb33e7abfe4ab953115ebaac24c71b4260..6909644da120b5098712e669053aa9ccedd8535c 100644
--- a/extensions/browser/api/cast_channel/logger_unittest.cc
+++ b/extensions/browser/api/cast_channel/logger_unittest.cc
@@ -29,7 +29,8 @@ class CastChannelLoggerTest : public testing::Test {
// |logger_| will take ownership of |clock_|.
CastChannelLoggerTest()
: clock_(new base::SimpleTestClock),
- logger_(new Logger(scoped_ptr<base::Clock>(clock_), base::Time())) {}
+ logger_(
+ new Logger(std::unique_ptr<base::Clock>(clock_), base::Time())) {}
~CastChannelLoggerTest() override {}
bool Uncompress(const char* input, int length, std::string* output) {
@@ -64,20 +65,20 @@ class CastChannelLoggerTest : public testing::Test {
return success;
}
- scoped_ptr<Log> GetLog() {
+ std::unique_ptr<Log> GetLog() {
size_t length = 0;
- scoped_ptr<char[]> output = logger_->GetLogs(&length);
+ std::unique_ptr<char[]> output = logger_->GetLogs(&length);
if (!output.get())
- return scoped_ptr<Log>();
+ return std::unique_ptr<Log>();
// 20kb should be enough for test purposes.
std::string uncompressed(20000, 0);
if (!Uncompress(output.get(), length, &uncompressed))
- return scoped_ptr<Log>();
+ return std::unique_ptr<Log>();
- scoped_ptr<Log> log(new Log);
+ std::unique_ptr<Log> log(new Log);
if (!log->ParseFromString(uncompressed))
- return scoped_ptr<Log>();
+ return std::unique_ptr<Log>();
return log;
}
@@ -117,7 +118,7 @@ TEST_F(CastChannelLoggerTest, BasicLogging) {
EXPECT_EQ(last_errors.challenge_reply_error_type,
proto::CHALLENGE_REPLY_ERROR_CERT_PARSING_FAILED);
- scoped_ptr<Log> log = GetLog();
+ std::unique_ptr<Log> log = GetLog();
ASSERT_TRUE(log);
ASSERT_EQ(2, log->aggregated_socket_event_size());
@@ -247,7 +248,7 @@ TEST_F(CastChannelLoggerTest, LogSocketReadWrite) {
logger_->LogSocketEventWithRv(2, EventType::SOCKET_WRITE, -5);
clock_->Advance(base::TimeDelta::FromMicroseconds(1));
- scoped_ptr<Log> log = GetLog();
+ std::unique_ptr<Log> log = GetLog();
ASSERT_TRUE(log);
ASSERT_EQ(2, log->aggregated_socket_event_size());
@@ -274,7 +275,7 @@ TEST_F(CastChannelLoggerTest, TooManySockets) {
logger_->LogSocketEvent(i, EventType::CAST_SOCKET_CREATED);
}
- scoped_ptr<Log> log = GetLog();
+ std::unique_ptr<Log> log = GetLog();
ASSERT_TRUE(log);
ASSERT_EQ(kMaxSocketsToLog, log->aggregated_socket_event_size());
@@ -292,7 +293,7 @@ TEST_F(CastChannelLoggerTest, TooManyEvents) {
clock_->Advance(base::TimeDelta::FromMicroseconds(1));
}
- scoped_ptr<Log> log = GetLog();
+ std::unique_ptr<Log> log = GetLog();
ASSERT_TRUE(log);
ASSERT_EQ(1, log->aggregated_socket_event_size());
@@ -308,7 +309,7 @@ TEST_F(CastChannelLoggerTest, TooManyEvents) {
TEST_F(CastChannelLoggerTest, Reset) {
logger_->LogSocketEvent(1, EventType::CAST_SOCKET_CREATED);
- scoped_ptr<Log> log = GetLog();
+ std::unique_ptr<Log> log = GetLog();
ASSERT_TRUE(log);
EXPECT_EQ(1, log->aggregated_socket_event_size());
« no previous file with comments | « extensions/browser/api/cast_channel/logger.cc ('k') | extensions/browser/api/declarative/declarative_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698