#include "media/capture/content/animated_content_sampler.h"
#include <stddef.h>
#include <stdint.h>
#include <cmath>
#include <memory>
#include <utility>
#include <vector>
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rect.h"
namespace media {
namespace {
base::TimeTicks InitialTestTimeTicks() { … }
base::TimeDelta FpsAsPeriod(int frame_rate) { … }
}
class AnimatedContentSamplerTest : public ::testing::Test { … };
TEST_F(AnimatedContentSamplerTest, ElectsNoneFromZeroDamageRects) { … }
TEST_F(AnimatedContentSamplerTest, ElectsMajorityFromOneDamageRect) { … }
TEST_F(AnimatedContentSamplerTest, ElectsNoneFromTwoDamageRectsOfSameArea) { … }
TEST_F(AnimatedContentSamplerTest, ElectsLargerOfTwoDamageRects_1) { … }
TEST_F(AnimatedContentSamplerTest, ElectsLargerOfTwoDamageRects_2) { … }
TEST_F(AnimatedContentSamplerTest, ElectsSameAsMooreDemonstration) { … }
TEST_F(AnimatedContentSamplerTest, Elects24FpsVideoInsteadOf48FpsSpinner) { … }
TEST_F(AnimatedContentSamplerTest, TargetsSamplingPeriod) { … }
namespace {
struct Scenario { … };
::std::ostream& operator<<(::std::ostream& os, const Scenario& s) { … }
}
class AnimatedContentSamplerParameterizedTest
: public AnimatedContentSamplerTest,
public ::testing::WithParamInterface<Scenario> { … };
TEST_P(AnimatedContentSamplerParameterizedTest, DetectsAnimatedContent) { … }
TEST_P(AnimatedContentSamplerParameterizedTest,
DoesNotLockInToTwoCompetingAnimations) { … }
TEST_P(AnimatedContentSamplerParameterizedTest, FrameTimestampsAreSmooth) { … }
TEST_P(AnimatedContentSamplerParameterizedTest,
FrameTimestampsConvergeTowardsEventTimes) { … }
INSTANTIATE_TEST_SUITE_P(…);
}