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

Unified Diff: Source/web/tests/WebFrameTest.cpp

Issue 278293002: [Regression] Fix Draggable is float:left and container is overflow:hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 6 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 | « Source/core/rendering/InlineFlowBox.cpp ('k') | Source/web/tests/data/nodeimage.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index 19911983b5549fb078b1ef8486fc0f597816ff0e..f6260f92c7510de32f9a285ebf00fd5c251a82cb 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -5508,40 +5508,55 @@ TEST_F(WebFrameTest, ReloadBypassingCache)
EXPECT_EQ(WebURLRequest::ReloadBypassingCache, frame->dataSource()->request().cachePolicy());
}
-TEST_F(WebFrameTest, NodeImageTestCSSTransform)
+static void nodeImageTestValidation(const WebCore::IntSize& referenceBitmapSize, WebCore::DragImage* dragImage)
{
- FrameTestHelpers::WebViewHelper webViewHelper;
- OwnPtr<WebCore::DragImage> dragImage = nodeImageTestSetup(&webViewHelper, std::string("case-css-transform"));
- EXPECT_TRUE(dragImage);
-
+ // Prepare the reference bitmap.
SkBitmap bitmap;
- ASSERT_TRUE(bitmap.allocN32Pixels(40, 40));
+ ASSERT_TRUE(bitmap.allocN32Pixels(referenceBitmapSize.width(), referenceBitmapSize.height()));
SkCanvas canvas(bitmap);
canvas.drawColor(SK_ColorGREEN);
- EXPECT_EQ(40, dragImage->size().width());
- EXPECT_EQ(40, dragImage->size().height());
+ EXPECT_EQ(referenceBitmapSize.width(), dragImage->size().width());
+ EXPECT_EQ(referenceBitmapSize.height(), dragImage->size().height());
const SkBitmap& dragBitmap = dragImage->bitmap();
SkAutoLockPixels lockPixel(dragBitmap);
EXPECT_EQ(0, memcmp(bitmap.getPixels(), dragBitmap.getPixels(), bitmap.getSize()));
}
+TEST_F(WebFrameTest, NodeImageTestCSSTransform)
+{
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ OwnPtr<WebCore::DragImage> dragImage = nodeImageTestSetup(&webViewHelper, std::string("case-css-transform"));
+ EXPECT_TRUE(dragImage);
+
+ nodeImageTestValidation(WebCore::IntSize(40, 40), dragImage.get());
+}
+
TEST_F(WebFrameTest, NodeImageTestCSS3DTransform)
{
FrameTestHelpers::WebViewHelper webViewHelper;
OwnPtr<WebCore::DragImage> dragImage = nodeImageTestSetup(&webViewHelper, std::string("case-css-3dtransform"));
EXPECT_TRUE(dragImage);
- SkBitmap bitmap;
- ASSERT_TRUE(bitmap.allocN32Pixels(20, 40));
- SkCanvas canvas(bitmap);
- canvas.drawColor(SK_ColorGREEN);
+ nodeImageTestValidation(WebCore::IntSize(20, 40), dragImage.get());
+}
- EXPECT_EQ(20, dragImage->size().width());
- EXPECT_EQ(40, dragImage->size().height());
- const SkBitmap& dragBitmap = dragImage->bitmap();
- SkAutoLockPixels lockPixel(dragBitmap);
- EXPECT_EQ(0, memcmp(bitmap.getPixels(), dragBitmap.getPixels(), bitmap.getSize()));
+TEST_F(WebFrameTest, NodeImageTestInlineBlock)
+{
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ OwnPtr<WebCore::DragImage> dragImage = nodeImageTestSetup(&webViewHelper, std::string("case-inlineblock"));
+ EXPECT_TRUE(dragImage);
+
+ nodeImageTestValidation(WebCore::IntSize(40, 40), dragImage.get());
+}
+
+TEST_F(WebFrameTest, NodeImageTestFloatLeft)
+{
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ OwnPtr<WebCore::DragImage> dragImage = nodeImageTestSetup(&webViewHelper, std::string("case-float-left-overflow-hidden"));
+ EXPECT_TRUE(dragImage);
+
+ nodeImageTestValidation(WebCore::IntSize(40, 40), dragImage.get());
}
class BrandColorTestWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
« no previous file with comments | « Source/core/rendering/InlineFlowBox.cpp ('k') | Source/web/tests/data/nodeimage.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698