| Index: third_party/WebKit/Source/core/frame/LocalFrameTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/LocalFrameTest.cpp b/third_party/WebKit/Source/core/frame/LocalFrameTest.cpp
|
| index 66f554427241956fe15aa623fb9fa343b1b4cf20..09ba4306eebf8160579e13884ad67cf15c7a751f 100644
|
| --- a/third_party/WebKit/Source/core/frame/LocalFrameTest.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/LocalFrameTest.cpp
|
| @@ -4,7 +4,10 @@
|
|
|
| #include "core/frame/LocalFrame.h"
|
|
|
| +#include "core/editing/FrameSelection.h"
|
| +#include "core/frame/FrameHost.h"
|
| #include "core/frame/FrameView.h"
|
| +#include "core/frame/VisualViewport.h"
|
| #include "core/html/HTMLElement.h"
|
| #include "core/testing/DummyPageHolder.h"
|
| #include "platform/DragImage.h"
|
| @@ -122,4 +125,23 @@ TEST_F(LocalFrameTest, nodeImageWithChangingLayoutObject)
|
| << "#sample doesn't have :-webkit-drag.";
|
| }
|
|
|
| +TEST_F(LocalFrameTest, dragImageForSelectionUsesPageScaleFactor)
|
| +{
|
| + setBodyContent(
|
| + "<div>Hello world! This tests that the bitmap for drag image is scaled by page scale factor</div>");
|
| + frame().host()->visualViewport().setScale(1);
|
| + frame().selection().selectAll();
|
| + updateAllLifecyclePhases();
|
| + const std::unique_ptr<DragImage> image1(frame().dragImageForSelection(0.75f));
|
| + frame().host()->visualViewport().setScale(2);
|
| + frame().selection().selectAll();
|
| + updateAllLifecyclePhases();
|
| + const std::unique_ptr<DragImage> image2(frame().dragImageForSelection(0.75f));
|
| +
|
| + EXPECT_GT(image1->size().width(), 0);
|
| + EXPECT_GT(image1->size().height(), 0);
|
| + EXPECT_EQ(image1->size().width() * 2, image2->size().width());
|
| + EXPECT_EQ(image1->size().height() * 2, image2->size().height());
|
| +}
|
| +
|
| } // namespace blink
|
|
|