OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "content/browser/media/capture/video_capture_oracle.h" | 5 #include "content/browser/media/capture/video_capture_oracle.h" |
6 | 6 |
7 #include <cstdlib> | 7 #include <cstdlib> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 { true, 33.441 }, { false, 16.72 }, { true, 16.72 }, { true, 50.16 } | 490 { true, 33.441 }, { false, 16.72 }, { true, 16.72 }, { true, 50.16 } |
491 }; | 491 }; |
492 | 492 |
493 SmoothEventSampler sampler(base::TimeDelta::FromSeconds(1) / 30, true, 3); | 493 SmoothEventSampler sampler(base::TimeDelta::FromSeconds(1) / 30, true, 3); |
494 ReplayCheckingSamplerDecisions(data_points, arraysize(data_points), &sampler); | 494 ReplayCheckingSamplerDecisions(data_points, arraysize(data_points), &sampler); |
495 } | 495 } |
496 | 496 |
497 class AnimatedContentSamplerTest : public ::testing::Test { | 497 class AnimatedContentSamplerTest : public ::testing::Test { |
498 public: | 498 public: |
499 AnimatedContentSamplerTest() {} | 499 AnimatedContentSamplerTest() {} |
500 virtual ~AnimatedContentSamplerTest() {} | 500 ~AnimatedContentSamplerTest() override {} |
501 | 501 |
502 virtual void SetUp() override { | 502 void SetUp() override { |
503 const base::TimeDelta since_epoch = | 503 const base::TimeDelta since_epoch = |
504 InitialTestTimeTicks() - base::TimeTicks::UnixEpoch(); | 504 InitialTestTimeTicks() - base::TimeTicks::UnixEpoch(); |
505 rand_seed_ = abs(static_cast<int>(since_epoch.InMicroseconds())); | 505 rand_seed_ = abs(static_cast<int>(since_epoch.InMicroseconds())); |
506 sampler_.reset(new AnimatedContentSampler(GetMinCapturePeriod())); | 506 sampler_.reset(new AnimatedContentSampler(GetMinCapturePeriod())); |
507 } | 507 } |
508 | 508 |
509 protected: | 509 protected: |
510 // Overridden by subclass for parameterized tests. | 510 // Overridden by subclass for parameterized tests. |
511 virtual base::TimeDelta GetMinCapturePeriod() const { | 511 virtual base::TimeDelta GetMinCapturePeriod() const { |
512 return base::TimeDelta::FromSeconds(1) / 30; | 512 return base::TimeDelta::FromSeconds(1) / 30; |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 // |event_increment|. | 1252 // |event_increment|. |
1253 const base::TimeDelta max_acceptable_delta = (i % 100) == 78 ? | 1253 const base::TimeDelta max_acceptable_delta = (i % 100) == 78 ? |
1254 event_increment * 5 : event_increment * 2; | 1254 event_increment * 5 : event_increment * 2; |
1255 EXPECT_GE(max_acceptable_delta.InMicroseconds(), delta.InMicroseconds()); | 1255 EXPECT_GE(max_acceptable_delta.InMicroseconds(), delta.InMicroseconds()); |
1256 } | 1256 } |
1257 last_frame_timestamp = frame_timestamp; | 1257 last_frame_timestamp = frame_timestamp; |
1258 } | 1258 } |
1259 } | 1259 } |
1260 | 1260 |
1261 } // namespace content | 1261 } // namespace content |
OLD | NEW |