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

Side by Side Diff: media/base/wall_clock_time_source_unittest.cc

Issue 1906423005: Replace scoped_ptr with std::unique_ptr in //media/base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-media-base: android Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « media/base/wall_clock_time_source.h ('k') | media/base/yuv_convert.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <memory>
6
5 #include "base/macros.h" 7 #include "base/macros.h"
6 #include "base/test/simple_test_tick_clock.h" 8 #include "base/test/simple_test_tick_clock.h"
7 #include "media/base/wall_clock_time_source.h" 9 #include "media/base/wall_clock_time_source.h"
8 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
9 11
10 namespace media { 12 namespace media {
11 13
12 class WallClockTimeSourceTest : public testing::Test { 14 class WallClockTimeSourceTest : public testing::Test {
13 public: 15 public:
14 WallClockTimeSourceTest() : tick_clock_(new base::SimpleTestTickClock()) { 16 WallClockTimeSourceTest() : tick_clock_(new base::SimpleTestTickClock()) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 48
47 bool IsTimeStopped() { 49 bool IsTimeStopped() {
48 bool is_time_moving = false; 50 bool is_time_moving = false;
49 // Convert any random value, it shouldn't matter for this call. 51 // Convert any random value, it shouldn't matter for this call.
50 ConvertMediaTime(base::TimeDelta::FromSeconds(1), &is_time_moving); 52 ConvertMediaTime(base::TimeDelta::FromSeconds(1), &is_time_moving);
51 return !is_time_moving; 53 return !is_time_moving;
52 } 54 }
53 55
54 protected: 56 protected:
55 WallClockTimeSource time_source_; 57 WallClockTimeSource time_source_;
56 scoped_ptr<base::SimpleTestTickClock> tick_clock_; 58 std::unique_ptr<base::SimpleTestTickClock> tick_clock_;
57 59
58 DISALLOW_COPY_AND_ASSIGN(WallClockTimeSourceTest); 60 DISALLOW_COPY_AND_ASSIGN(WallClockTimeSourceTest);
59 }; 61 };
60 62
61 TEST_F(WallClockTimeSourceTest, InitialTimeIsZero) { 63 TEST_F(WallClockTimeSourceTest, InitialTimeIsZero) {
62 EXPECT_EQ(0, CurrentMediaTimeInSeconds()); 64 EXPECT_EQ(0, CurrentMediaTimeInSeconds());
63 EXPECT_TRUE(IsTimeStopped()); 65 EXPECT_TRUE(IsTimeStopped());
64 } 66 }
65 67
66 TEST_F(WallClockTimeSourceTest, InitialTimeIsNotTicking) { 68 TEST_F(WallClockTimeSourceTest, InitialTimeIsNotTicking) {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 159
158 wall_clock_times.clear(); 160 wall_clock_times.clear();
159 time_source_.StopTicking(); 161 time_source_.StopTicking();
160 is_time_moving = time_source_.GetWallClockTimes( 162 is_time_moving = time_source_.GetWallClockTimes(
161 std::vector<base::TimeDelta>(), &wall_clock_times); 163 std::vector<base::TimeDelta>(), &wall_clock_times);
162 EXPECT_FALSE(is_time_moving); 164 EXPECT_FALSE(is_time_moving);
163 EXPECT_EQ(tick_clock_->NowTicks(), wall_clock_times[0]); 165 EXPECT_EQ(tick_clock_->NowTicks(), wall_clock_times[0]);
164 } 166 }
165 167
166 } // namespace media 168 } // namespace media
OLDNEW
« no previous file with comments | « media/base/wall_clock_time_source.h ('k') | media/base/yuv_convert.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698