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

Side by Side Diff: media/test/pipeline_integration_test.cc

Issue 2405453002: Fix Integer-overflow in base::Time::FromExploded. (Closed)
Patch Set: rebased and fixed net unittest Created 4 years, 1 month 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/formats/webm/webm_info_parser.cc ('k') | net/http/http_util_unittest.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 (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
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
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
OLDNEW
« no previous file with comments | « media/formats/webm/webm_info_parser.cc ('k') | net/http/http_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698