chromium/third_party/blink/renderer/core/html/image_document_test.cc

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

#include "third_party/blink/renderer/core/html/image_document.h"

#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/document_init.h"
#include "third_party/blink/renderer/core/dom/document_parser.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/geometry/dom_rect.h"
#include "third_party/blink/renderer/core/html/html_image_element.h"
#include "third_party/blink/renderer/core/loader/empty_clients.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/testing/dummy_page_holder.h"
#include "third_party/blink/renderer/core/testing/sim/sim_request.h"
#include "third_party/blink/renderer/core/testing/sim/sim_test.h"
#include "third_party/blink/renderer/platform/heap/thread_state.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"

namespace blink {

namespace {

// A non-animated jpeg image of size 50x50.
Vector<unsigned char> JpegImage() {}

// An animated webp image of size 50x50.
Vector<unsigned char> AnimatedWebpImage() {}
}  // namespace

class WindowToViewportScalingChromeClient : public EmptyChromeClient {};

class ImageDocumentTest : public testing::Test {};

void ImageDocumentTest::CreateDocumentWithoutLoadingImage(int view_width,
                                                          int view_height,
                                                          bool is_animated) {}

void ImageDocumentTest::CreateDocument(int view_width,
                                       int view_height,
                                       bool is_animated /*=false*/) {}

ImageDocument& ImageDocumentTest::GetDocument() const {}

void ImageDocumentTest::SetPageZoom(float factor) {}

void ImageDocumentTest::SetWindowToViewportScalingFactor(float factor) {}

void ImageDocumentTest::SetForceZeroLayoutHeight(bool force) {}

TEST_F(ImageDocumentTest, ImageLoad) {}

TEST_F(ImageDocumentTest, LargeImageScalesDown) {}

TEST_F(ImageDocumentTest, RestoreImageOnClick) {}

TEST_F(ImageDocumentTest, InitialZoomDoesNotAffectScreenFit) {}

TEST_F(ImageDocumentTest, ZoomingDoesNotChangeRelativeSize) {}

TEST_F(ImageDocumentTest, ImageScalesDownWithDsf) {}

TEST_F(ImageDocumentTest, ImageNotCenteredWithForceZeroLayoutHeight) {}

TEST_F(ImageDocumentTest, ImageCenteredWithoutForceZeroLayoutHeight) {}

TEST_F(ImageDocumentTest, DomInteractive) {}

TEST_F(ImageDocumentTest, ImageSrcChangedBeforeFinish) {}

TEST_F(ImageDocumentTest, ImageStyleContainsTransitionForNonAnimatedImage) {}

TEST_F(ImageDocumentTest, ImageStyleDoesNotContainTransitionForAnimatedImage) {}

#if BUILDFLAG(IS_ANDROID)
#define MAYBE
#else
#define MAYBE
#endif

TEST_F(ImageDocumentTest, MAYBE(ImageCenteredAtDeviceScaleFactor)) {}

class ImageDocumentViewportTest : public SimTest {};

// Tests that hiding the URL bar doesn't cause a "jump" when viewing an image
// much wider than the viewport.
TEST_F(ImageDocumentViewportTest, HidingURLBarDoesntChangeImageLocation) {}

TEST_F(ImageDocumentViewportTest, ScaleImage) {}

// Tests that with zoom factor for device scale factor, image with different
// size fit in the viewport correctly.
TEST_F(ImageDocumentViewportTest, DivWidth) {}

#undef MAYBE
}  // namespace blink