| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/smooth_event_sampler.h" | 5 #include "media/capture/smooth_event_sampler.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace media { |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 bool AddEventAndConsiderSampling(SmoothEventSampler* sampler, | 14 bool AddEventAndConsiderSampling(SmoothEventSampler* sampler, |
| 15 base::TimeTicks event_time) { | 15 base::TimeTicks event_time) { |
| 16 sampler->ConsiderPresentationEvent(event_time); | 16 sampler->ConsiderPresentationEvent(event_time); |
| 17 return sampler->ShouldSample(); | 17 return sampler->ShouldSample(); |
| 18 } | 18 } |
| 19 | 19 |
| 20 void SteadyStateSampleAndAdvance(base::TimeDelta vsync, | 20 void SteadyStateSampleAndAdvance(base::TimeDelta vsync, |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 { true, 33.441 }, { false, 0 }, { true, 33.44 }, { false, 16.72 }, | 478 { true, 33.441 }, { false, 0 }, { true, 33.44 }, { false, 16.72 }, |
| 479 { true, 33.44 }, { false, 0 }, { true, 16.721 }, { true, 50.161 }, | 479 { true, 33.44 }, { false, 0 }, { true, 16.721 }, { true, 50.161 }, |
| 480 { false, 0 }, { true, 16.72 }, { true, 33.44 }, { false, 0 }, | 480 { false, 0 }, { true, 16.72 }, { true, 33.44 }, { false, 0 }, |
| 481 { true, 33.441 }, { false, 16.72 }, { true, 16.72 }, { true, 50.16 } | 481 { true, 33.441 }, { false, 16.72 }, { true, 16.72 }, { true, 50.16 } |
| 482 }; | 482 }; |
| 483 | 483 |
| 484 SmoothEventSampler sampler(base::TimeDelta::FromSeconds(1) / 30, 3); | 484 SmoothEventSampler sampler(base::TimeDelta::FromSeconds(1) / 30, 3); |
| 485 ReplayCheckingSamplerDecisions(data_points, arraysize(data_points), &sampler); | 485 ReplayCheckingSamplerDecisions(data_points, arraysize(data_points), &sampler); |
| 486 } | 486 } |
| 487 | 487 |
| 488 } // namespace content | 488 } // namespace media |
| OLD | NEW |