chromium/media/capture/content/animated_content_sampler_unittest.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

}  // namespace

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 {

// A test scenario for AnimatedContentSamplerParameterizedTest.
struct Scenario {};

// Value printer for Scenario.
::std::ostream& operator<<(::std::ostream& os, const Scenario& s) {}

}  // namespace

class AnimatedContentSamplerParameterizedTest
    : public AnimatedContentSamplerTest,
      public ::testing::WithParamInterface<Scenario> {};

// Tests that the implementation locks in/out of frames containing stable
// animated content, whether or not random events are also simultaneously
// present.
TEST_P(AnimatedContentSamplerParameterizedTest, DetectsAnimatedContent) {}

// Tests that AnimatedContentSampler won't lock in to, nor flip-flop between,
// two animations of the same pixel change rate.  VideoCaptureOracle should
// revert to using the SmoothEventSampler for these kinds of situations, as
// there is no "right answer" as to which animation to lock into.
TEST_P(AnimatedContentSamplerParameterizedTest,
       DoesNotLockInToTwoCompetingAnimations) {}

// Tests that the frame timestamps are smooth; meaning, that when run through a
// simulated compositor, each frame is held displayed for the right number of
// v-sync intervals.
TEST_P(AnimatedContentSamplerParameterizedTest, FrameTimestampsAreSmooth) {}

// Tests that frame timestamps are "lightly pushed" back towards the original
// presentation event times, which tells us the AnimatedContentSampler can
// account for sources of timestamp drift and correct the drift.
TEST_P(AnimatedContentSamplerParameterizedTest,
       FrameTimestampsConvergeTowardsEventTimes) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace media