OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // Return a timeline offset for bear-320x240-live.webm. | 166 // Return a timeline offset for bear-320x240-live.webm. |
167 static base::Time kLiveTimelineOffset() { | 167 static base::Time kLiveTimelineOffset() { |
168 // The file contians the following UTC timeline offset: | 168 // The file contians the following UTC timeline offset: |
169 // 2012-11-10 12:34:56.789123456 | 169 // 2012-11-10 12:34:56.789123456 |
170 // Since base::Time only has a resolution of microseconds, | 170 // Since base::Time only has a resolution of microseconds, |
171 // construct a base::Time for 2012-11-10 12:34:56.789123. | 171 // construct a base::Time for 2012-11-10 12:34:56.789123. |
172 base::Time::Exploded exploded_time; | 172 base::Time::Exploded exploded_time; |
173 exploded_time.year = 2012; | 173 exploded_time.year = 2012; |
174 exploded_time.month = 11; | 174 exploded_time.month = 11; |
175 exploded_time.day_of_month = 10; | 175 exploded_time.day_of_month = 10; |
| 176 exploded_time.day_of_week = 6; |
176 exploded_time.hour = 12; | 177 exploded_time.hour = 12; |
177 exploded_time.minute = 34; | 178 exploded_time.minute = 34; |
178 exploded_time.second = 56; | 179 exploded_time.second = 56; |
179 exploded_time.millisecond = 789; | 180 exploded_time.millisecond = 789; |
180 base::Time timeline_offset; | 181 base::Time timeline_offset; |
181 EXPECT_TRUE(base::Time::FromUTCExploded(exploded_time, &timeline_offset)); | 182 EXPECT_TRUE(base::Time::FromUTCExploded(exploded_time, &timeline_offset)); |
182 | 183 |
183 timeline_offset += base::TimeDelta::FromMicroseconds(123); | 184 timeline_offset += base::TimeDelta::FromMicroseconds(123); |
184 | 185 |
185 return timeline_offset; | 186 return timeline_offset; |
(...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2478 | 2479 |
2479 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 2480 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
2480 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); | 2481 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); |
2481 Play(); | 2482 Play(); |
2482 ASSERT_TRUE(WaitUntilOnEnded()); | 2483 ASSERT_TRUE(WaitUntilOnEnded()); |
2483 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 2484 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
2484 demuxer_->GetStartTime()); | 2485 demuxer_->GetStartTime()); |
2485 } | 2486 } |
2486 | 2487 |
2487 } // namespace media | 2488 } // namespace media |
OLD | NEW |