OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This test generate synthetic data. For audio it's a sinusoid waveform with | 5 // This test generate synthetic data. For audio it's a sinusoid waveform with |
6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern | 6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern |
7 // that is shifting by one pixel per frame, each pixels neighbors right and down | 7 // that is shifting by one pixel per frame, each pixels neighbors right and down |
8 // is this pixels value +1, since the pixel value is 8 bit it will wrap | 8 // is this pixels value +1, since the pixel value is 8 bit it will wrap |
9 // frequently within the image. Visually this will create diagonally color bands | 9 // frequently within the image. Visually this will create diagonally color bands |
10 // that moves across the screen | 10 // that moves across the screen |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 << (playout_time - last_playout_time_).InMicroseconds() << " usec."; | 296 << (playout_time - last_playout_time_).InMicroseconds() << " usec."; |
297 last_playout_time_ = playout_time; | 297 last_playout_time_ = playout_time; |
298 | 298 |
299 EXPECT_TRUE(is_continuous); | 299 EXPECT_TRUE(is_continuous); |
300 } | 300 } |
301 | 301 |
302 int number_times_called() const { return num_called_; } | 302 int number_times_called() const { return num_called_; } |
303 | 303 |
304 protected: | 304 protected: |
305 virtual ~TestReceiverAudioCallback() { | 305 virtual ~TestReceiverAudioCallback() { |
306 STLDeleteElements(&expected_frames_); | 306 base::STLDeleteElements(&expected_frames_); |
307 } | 307 } |
308 | 308 |
309 private: | 309 private: |
310 friend class base::RefCountedThreadSafe<TestReceiverAudioCallback>; | 310 friend class base::RefCountedThreadSafe<TestReceiverAudioCallback>; |
311 | 311 |
312 int num_called_; | 312 int num_called_; |
313 int expected_sampling_frequency_; | 313 int expected_sampling_frequency_; |
314 std::list<ExpectedAudioFrame*> expected_frames_; | 314 std::list<ExpectedAudioFrame*> expected_frames_; |
315 base::TimeTicks last_playout_time_; | 315 base::TimeTicks last_playout_time_; |
316 }; | 316 }; |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 EXPECT_EQ(0u, jump); | 1270 EXPECT_EQ(0u, jump); |
1271 jump = i; | 1271 jump = i; |
1272 } | 1272 } |
1273 } | 1273 } |
1274 EXPECT_GT(jump, 49u); | 1274 EXPECT_GT(jump, 49u); |
1275 EXPECT_LT(jump, 120u); | 1275 EXPECT_LT(jump, 120u); |
1276 } | 1276 } |
1277 | 1277 |
1278 } // namespace cast | 1278 } // namespace cast |
1279 } // namespace media | 1279 } // namespace media |
OLD | NEW |