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

Unified Diff: third_party/WebKit/Source/core/layout/line/InlineBoxTest.cpp

Issue 2536453002: Rename some functions about layout locations (Closed)
Patch Set: Rebase Created 4 years, 1 month 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
Index: third_party/WebKit/Source/core/layout/line/InlineBoxTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/line/InlineBoxTest.cpp b/third_party/WebKit/Source/core/layout/line/InlineBoxTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2c779d438e66c9e9623c673fd191111fd7933acf
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/line/InlineBoxTest.cpp
@@ -0,0 +1,46 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/layout/line/InlineBox.h"
+
+#include "core/layout/LayoutBlockFlow.h"
+#include "core/layout/LayoutTestHelper.h"
+
+namespace blink {
+
+using InlineBoxTest = RenderingTest;
+
+TEST_F(InlineBoxTest, LogicalRectToPhysicalRectNormal) {
+ setBodyInnerHTML(
+ "<div id='div' style='width: 80px; height: 50px'>Test</div>");
+ LayoutBlockFlow* div = toLayoutBlockFlow(getLayoutObjectByElementId("div"));
+ InlineBox* inlineBox = div->firstLineBox();
+ LayoutRect rect(11, 22, 33, 44);
+ inlineBox->logicalRectToPhysicalRect(rect);
+ EXPECT_EQ(LayoutRect(11, 22, 33, 44), rect);
+}
+
+TEST_F(InlineBoxTest, LogicalRectToPhysicalRectVerticalRL) {
+ setBodyInnerHTML(
+ "<div id='div' "
+ "style='writing-mode:vertical-rl; width: 80px; height: 50px'>Test</div>");
+ LayoutBlockFlow* div = toLayoutBlockFlow(getLayoutObjectByElementId("div"));
+ InlineBox* inlineBox = div->firstLineBox();
+ LayoutRect rect(11, 22, 33, 44);
+ inlineBox->logicalRectToPhysicalRect(rect);
+ EXPECT_EQ(LayoutRect(14, 11, 44, 33), rect);
+}
+
+TEST_F(InlineBoxTest, LogicalRectToPhysicalRectVerticalLR) {
+ setBodyInnerHTML(
+ "<div id='div' "
+ "style='writing-mode:vertical-lr; width: 80px; height: 50px'>Test</div>");
+ LayoutBlockFlow* div = toLayoutBlockFlow(getLayoutObjectByElementId("div"));
+ InlineBox* inlineBox = div->firstLineBox();
+ LayoutRect rect(11, 22, 33, 44);
+ inlineBox->logicalRectToPhysicalRect(rect);
+ EXPECT_EQ(LayoutRect(22, 11, 44, 33), rect);
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineBox.cpp ('k') | third_party/WebKit/Source/core/layout/line/InlineFlowBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698