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

Side by Side Diff: third_party/WebKit/Source/web/tests/NGInlineLayoutTest.cpp

Issue 2692643002: Change how NGConstraintSpaceBuilder specified destination space. (Closed)
Patch Set: CR fixes, merge w master Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/ng/layout_ng_block_flow.h" 5 #include "core/layout/ng/layout_ng_block_flow.h"
6 #include "core/layout/ng/ng_block_layout_algorithm.h" 6 #include "core/layout/ng/ng_block_layout_algorithm.h"
7 #include "core/layout/ng/ng_constraint_space_builder.h" 7 #include "core/layout/ng/ng_constraint_space_builder.h"
8 #include "core/layout/ng/ng_inline_node.h" 8 #include "core/layout/ng/ng_inline_node.h"
9 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" 9 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
10 #include "platform/testing/UnitTestHelpers.h" 10 #include "platform/testing/UnitTestHelpers.h"
11 #include "web/WebViewImpl.h" 11 #include "web/WebViewImpl.h"
12 #include "web/tests/sim/SimCompositor.h" 12 #include "web/tests/sim/SimCompositor.h"
13 #include "web/tests/sim/SimDisplayItemList.h" 13 #include "web/tests/sim/SimDisplayItemList.h"
14 #include "web/tests/sim/SimRequest.h" 14 #include "web/tests/sim/SimRequest.h"
15 #include "web/tests/sim/SimTest.h" 15 #include "web/tests/sim/SimTest.h"
16 #include "wtf/CurrentTime.h" 16 #include "wtf/CurrentTime.h"
17 #include "wtf/text/CharacterNames.h" 17 #include "wtf/text/CharacterNames.h"
18 18
19 namespace blink { 19 namespace blink {
20 20
21 class NGInlineLayoutTest : public SimTest { 21 class NGInlineLayoutTest : public SimTest {
22 public: 22 public:
23 NGConstraintSpace* constraintSpaceForElement(LayoutNGBlockFlow* blockFlow) { 23 NGConstraintSpace* constraintSpaceForElement(LayoutNGBlockFlow* blockFlow) {
24 return NGConstraintSpaceBuilder( 24 return NGConstraintSpaceBuilder(
25 FromPlatformWritingMode(blockFlow->style()->getWritingMode())) 25 FromPlatformWritingMode(blockFlow->style()->getWritingMode()))
26 .SetAvailableSize(NGLogicalSize(LayoutUnit(), LayoutUnit())) 26 .SetAvailableSize(NGLogicalSize(LayoutUnit(), LayoutUnit()))
27 .SetPercentageResolutionSize(NGLogicalSize(LayoutUnit(), LayoutUnit())) 27 .SetPercentageResolutionSize(NGLogicalSize(LayoutUnit(), LayoutUnit()))
28 .SetTextDirection(blockFlow->style()->direction()) 28 .SetTextDirection(blockFlow->style()->direction())
29 .ToConstraintSpace(); 29 .ToConstraintSpace(
30 FromPlatformWritingMode(blockFlow->style()->getWritingMode()));
30 } 31 }
31 }; 32 };
32 33
33 TEST_F(NGInlineLayoutTest, BlockWithSingleTextNode) { 34 TEST_F(NGInlineLayoutTest, BlockWithSingleTextNode) {
34 RuntimeEnabledFeatures::setLayoutNGEnabled(true); 35 RuntimeEnabledFeatures::setLayoutNGEnabled(true);
35 RuntimeEnabledFeatures::setLayoutNGInlineEnabled(true); 36 RuntimeEnabledFeatures::setLayoutNGInlineEnabled(true);
36 37
37 SimRequest mainResource("https://example.com/", "text/html"); 38 SimRequest mainResource("https://example.com/", "text/html");
38 loadURL("https://example.com/"); 39 loadURL("https://example.com/");
39 mainResource.complete( 40 mainResource.complete(
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 String expectedText("Hello "); 85 String expectedText("Hello ");
85 expectedText.append(objectReplacementCharacter); 86 expectedText.append(objectReplacementCharacter);
86 expectedText.append("."); 87 expectedText.append(".");
87 EXPECT_EQ(expectedText, inlineBox->Text(0, 8)); 88 EXPECT_EQ(expectedText, inlineBox->Text(0, 8));
88 89
89 // Delete the line box tree to avoid leaks in the test. 90 // Delete the line box tree to avoid leaks in the test.
90 blockFlow->deleteLineBoxTree(); 91 blockFlow->deleteLineBoxTree();
91 } 92 }
92 93
93 } // namespace blink 94 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698