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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 : public AnimatedContentSamplerTest, | 665 : public AnimatedContentSamplerTest, |
666 public ::testing::WithParamInterface<Scenario> { | 666 public ::testing::WithParamInterface<Scenario> { |
667 public: | 667 public: |
668 AnimatedContentSamplerParameterizedTest() | 668 AnimatedContentSamplerParameterizedTest() |
669 : count_dropped_frames_(0), count_sampled_frames_(0) {} | 669 : count_dropped_frames_(0), count_sampled_frames_(0) {} |
670 virtual ~AnimatedContentSamplerParameterizedTest() {} | 670 virtual ~AnimatedContentSamplerParameterizedTest() {} |
671 | 671 |
672 protected: | 672 protected: |
673 typedef std::pair<gfx::Rect, base::TimeTicks> Event; | 673 typedef std::pair<gfx::Rect, base::TimeTicks> Event; |
674 | 674 |
675 virtual base::TimeDelta GetMinCapturePeriod() const override { | 675 base::TimeDelta GetMinCapturePeriod() const override { |
676 return GetParam().min_capture_period; | 676 return GetParam().min_capture_period; |
677 } | 677 } |
678 | 678 |
679 // Generate a sequence of events from the compositor pipeline. The event | 679 // Generate a sequence of events from the compositor pipeline. The event |
680 // times will all be at compositor vsync boundaries. | 680 // times will all be at compositor vsync boundaries. |
681 std::vector<Event> GenerateEventSequence(base::TimeTicks begin, | 681 std::vector<Event> GenerateEventSequence(base::TimeTicks begin, |
682 base::TimeTicks end, | 682 base::TimeTicks end, |
683 bool include_content_frame_events, | 683 bool include_content_frame_events, |
684 bool include_random_events) { | 684 bool include_random_events) { |
685 DCHECK(GetParam().content_period >= GetParam().vsync_interval); | 685 DCHECK(GetParam().content_period >= GetParam().vsync_interval); |
(...skipping 566 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 |