#include "chrome/browser/ui/thumbnails/thumbnail_capture_driver.h"
#include "base/test/task_environment.h"
#include "chrome/browser/ui/thumbnails/thumbnail_scheduler.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
class MockClient : public ThumbnailCaptureDriver::Client { … };
class StubScheduler : public ThumbnailScheduler { … };
class ThumbnailCaptureDriverTest : public ::testing::Test { … };
}
AnyNumber;
AtLeast;
Expectation;
InSequence;
TEST_F(ThumbnailCaptureDriverTest,
NoCaptureWhenPageIsVisibleAndThumbnailIsNot) { … }
TEST_F(ThumbnailCaptureDriverTest,
CaptureWhenPageIsVisibleAndThumbnailIsRequested) { … }
TEST_F(ThumbnailCaptureDriverTest, NoCaptureWhenPageAndThumbnailAreNotVisible) { … }
TEST_F(ThumbnailCaptureDriverTest,
CaptureRequestedWhenPageReadyAndSchedulerAllows) { … }
TEST_F(ThumbnailCaptureDriverTest, CapturesPageWhenPossible) { … }
TEST_F(ThumbnailCaptureDriverTest,
AlwaysWaitsForSchedulerAndCallsRequestCapture) { … }
TEST_F(ThumbnailCaptureDriverTest, FinalCaptureWaitsForScheduler) { … }
TEST_F(ThumbnailCaptureDriverTest, StopsCaptureThenResumesFromScheduler) { … }
TEST_F(ThumbnailCaptureDriverTest, RestartsCaptureWhenPossible) { … }
TEST_F(ThumbnailCaptureDriverTest, StopsOngoingCaptureWhenPageNoLongerReady) { … }
TEST_F(ThumbnailCaptureDriverTest, CanContinueCaptureIfPageBecomesVisible) { … }
TEST_F(ThumbnailCaptureDriverTest, ContinuesCaptureWhenPageBecomesFinal) { … }
TEST_F(ThumbnailCaptureDriverTest, StopsCaptureOnFinalFrame) { … }
TEST_F(ThumbnailCaptureDriverTest, RetriesWithinLimits) { … }
TEST_F(ThumbnailCaptureDriverTest, StopsCaptureAtRetryLimit) { … }
TEST_F(ThumbnailCaptureDriverTest, DoesNotReCaptureAfterFinalThumbnail) { … }
TEST_F(ThumbnailCaptureDriverTest, InvalidatesThumbnailOnReadinessDecrease) { … }