Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrameTest.cpp

Issue 2361653003: Fix the scale of Drag and Drop shadow image. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698