#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/capture/content/smooth_event_sampler.h"
#include <stddef.h>
#include <stdint.h>
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
namespace {
bool AddEventAndConsiderSampling(SmoothEventSampler* sampler,
base::TimeTicks event_time) { … }
void SteadyStateSampleAndAdvance(base::TimeDelta vsync,
SmoothEventSampler* sampler,
base::TimeTicks* t) { … }
void SteadyStateNoSampleAndAdvance(base::TimeDelta vsync,
SmoothEventSampler* sampler,
base::TimeTicks* t) { … }
base::TimeTicks InitialTestTimeTicks() { … }
}
TEST(SmoothEventSamplerTest, Sample60HertzAt30Hertz) { … }
TEST(SmoothEventSamplerTest, Sample50HertzAt30Hertz) { … }
TEST(SmoothEventSamplerTest, Sample75HertzAt30Hertz) { … }
TEST(SmoothEventSamplerTest, Sample30HertzAt30Hertz) { … }
TEST(SmoothEventSamplerTest, Sample24HertzAt30Hertz) { … }
TEST(SmoothEventSamplerTest, Sample60HertzWithVariedCapturePeriods) { … }
namespace {
struct DataPoint { … };
void ReplayCheckingSamplerDecisions(const DataPoint* data_points,
size_t num_data_points,
SmoothEventSampler* sampler) { … }
}
TEST(SmoothEventSamplerTest, DrawingAt24FpsWith60HzVsyncSampledAt30Hertz) { … }
TEST(SmoothEventSamplerTest, DrawingAt30FpsWith60HzVsyncSampledAt30Hertz) { … }
TEST(SmoothEventSamplerTest, DrawingAt60FpsWith60HzVsyncSampledAt30Hertz) { … }
}