Merge "metricsd: Remove release/aquire semantic from scoped_ptr/unique_ptr"

This commit is contained in:
Alex Vakulenko 2016-04-08 18:03:00 +00:00 committed by Gerrit Code Review
commit a10b4a0235

View file

@ -69,7 +69,7 @@ TEST_F(TimerTest, StartStop) {
EXPECT_CALL(*clock_wrapper_mock_, GetCurrentTime())
.WillOnce(Return(stime))
.WillOnce(Return(etime));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
ASSERT_TRUE(timer_.Start());
ASSERT_TRUE(timer_.start_time_ == stime);
ASSERT_TRUE(timer_.HasStarted());
@ -88,7 +88,7 @@ TEST_F(TimerTest, ReStart) {
EXPECT_CALL(*clock_wrapper_mock_, GetCurrentTime())
.WillOnce(Return(stime))
.WillOnce(Return(etime));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
timer_.Start();
base::TimeTicks buffer = timer_.start_time_;
timer_.Start();
@ -98,7 +98,7 @@ TEST_F(TimerTest, ReStart) {
TEST_F(TimerTest, Reset) {
EXPECT_CALL(*clock_wrapper_mock_, GetCurrentTime())
.WillOnce(Return(stime));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
timer_.Start();
ASSERT_TRUE(timer_.Reset());
ASSERT_FALSE(timer_.HasStarted());
@ -110,7 +110,7 @@ TEST_F(TimerTest, SeparatedTimers) {
.WillOnce(Return(etime))
.WillOnce(Return(stime2))
.WillOnce(Return(etime2));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
ASSERT_TRUE(timer_.Start());
ASSERT_TRUE(timer_.Stop());
ASSERT_EQ(timer_.elapsed_time_.InMilliseconds(), kDelta1MSec);
@ -130,7 +130,7 @@ TEST_F(TimerTest, InvalidStop) {
EXPECT_CALL(*clock_wrapper_mock_, GetCurrentTime())
.WillOnce(Return(stime))
.WillOnce(Return(etime));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
ASSERT_FALSE(timer_.Stop());
// Now we try it again, but after a valid start/stop.
timer_.Start();
@ -152,7 +152,7 @@ TEST_F(TimerTest, PauseStartStopResume) {
.WillOnce(Return(etime2))
.WillOnce(Return(stime3))
.WillOnce(Return(etime3));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
ASSERT_TRUE(timer_.Pause()); // Starts timer paused.
ASSERT_TRUE(timer_.start_time_ == stime);
ASSERT_TRUE(timer_.HasStarted());
@ -181,7 +181,7 @@ TEST_F(TimerTest, ResumeStartStopPause) {
.WillOnce(Return(stime2))
.WillOnce(Return(etime2))
.WillOnce(Return(stime3));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
ASSERT_TRUE(timer_.Resume());
ASSERT_TRUE(timer_.start_time_ == stime);
ASSERT_TRUE(timer_.HasStarted());
@ -208,7 +208,7 @@ TEST_F(TimerTest, StartResumeStop) {
EXPECT_CALL(*clock_wrapper_mock_, GetCurrentTime())
.WillOnce(Return(stime))
.WillOnce(Return(etime));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
ASSERT_TRUE(timer_.Start());
ASSERT_TRUE(timer_.start_time_ == stime);
ASSERT_TRUE(timer_.HasStarted());
@ -230,7 +230,7 @@ TEST_F(TimerTest, StartPauseStop) {
EXPECT_CALL(*clock_wrapper_mock_, GetCurrentTime())
.WillOnce(Return(stime))
.WillOnce(Return(etime));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
ASSERT_TRUE(timer_.Start());
ASSERT_TRUE(timer_.start_time_ == stime);
ASSERT_TRUE(timer_.HasStarted());
@ -257,7 +257,7 @@ TEST_F(TimerTest, StartPauseResumeStop) {
.WillOnce(Return(etime))
.WillOnce(Return(stime2))
.WillOnce(Return(etime2));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
ASSERT_TRUE(timer_.Start());
ASSERT_TRUE(timer_.start_time_ == stime);
ASSERT_TRUE(timer_.HasStarted());
@ -284,7 +284,7 @@ TEST_F(TimerTest, StartPauseResumeStop) {
TEST_F(TimerTest, PauseStop) {
EXPECT_CALL(*clock_wrapper_mock_, GetCurrentTime())
.WillOnce(Return(stime));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
ASSERT_TRUE(timer_.Pause());
ASSERT_TRUE(timer_.start_time_ == stime);
ASSERT_TRUE(timer_.HasStarted());
@ -304,7 +304,7 @@ TEST_F(TimerTest, PauseResumeStop) {
.WillOnce(Return(stime))
.WillOnce(Return(stime2))
.WillOnce(Return(etime2));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
ASSERT_TRUE(timer_.Pause());
ASSERT_TRUE(timer_.start_time_ == stime);
ASSERT_TRUE(timer_.HasStarted());
@ -328,7 +328,7 @@ TEST_F(TimerTest, StartPauseResumePauseStop) {
.WillOnce(Return(stime2))
.WillOnce(Return(stime3))
.WillOnce(Return(etime3));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
ASSERT_TRUE(timer_.Start());
ASSERT_TRUE(timer_.start_time_ == stime);
ASSERT_TRUE(timer_.HasStarted());
@ -373,7 +373,7 @@ TEST_F(TimerTest, StartPauseResumePauseResumeStop) {
.WillOnce(Return(etime2))
.WillOnce(Return(stime3))
.WillOnce(Return(etime3));
timer_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_.clock_wrapper_ = std::move(clock_wrapper_mock_);
ASSERT_TRUE(timer_.Start());
ASSERT_TRUE(timer_.start_time_ == stime);
ASSERT_TRUE(timer_.HasStarted());
@ -444,7 +444,7 @@ TEST_F(TimerReporterTest, StartStopReport) {
EXPECT_CALL(*clock_wrapper_mock_, GetCurrentTime())
.WillOnce(Return(stime))
.WillOnce(Return(etime));
timer_reporter_.clock_wrapper_.reset(clock_wrapper_mock_.release());
timer_reporter_.clock_wrapper_ = std::move(clock_wrapper_mock_);
EXPECT_CALL(lib_, SendToUMA(kMetricName, kDelta1MSec, kMinSample, kMaxSample,
kNumBuckets)).WillOnce(Return(true));
ASSERT_TRUE(timer_reporter_.Start());