Fixed Issue #1232: WrapLayout crashes when itemWidth value is too high.

This commit is contained in:
Rossen Hristov
2016-02-05 15:51:50 +02:00
parent aedbf3bdeb
commit 2f8bce74fb
2 changed files with 37 additions and 12 deletions

View File

@@ -182,6 +182,14 @@ export class WrapLayoutTest extends testModule.UITest<wrapLayoutModule.WrapLayou
TKUnit.assertEqual(actualValue, 50, "ActualLeft on Index 1");
}
public testItemWidthLargerThanTheAvailableWidth() {
this.testView.itemWidth = layoutHelper.dp(1000);
this.waitUntilTestElementLayoutIsValid();
TKUnit.assertEqual(this.testView.getChildAt(0)._getCurrentLayoutBounds().top, 0, "ActualTop on Index 0");
TKUnit.assertEqual(this.testView.getChildAt(1)._getCurrentLayoutBounds().top, 100, "ActualTop on Index 1");
}
public testItemHeight() {
this.testView.itemHeight = layoutHelper.dp(50);
this.testView.orientation = enums.Orientation.vertical;
@@ -201,6 +209,16 @@ export class WrapLayoutTest extends testModule.UITest<wrapLayoutModule.WrapLayou
TKUnit.assertEqual(actualValue, 50, "ActualTop on Index 1");
}
public testItemHeightLargerThanTheAvailableHeight() {
this.testView.orientation = enums.Orientation.vertical;
this.waitUntilTestElementLayoutIsValid();
this.testView.itemHeight = layoutHelper.dp(1000);
this.waitUntilTestElementLayoutIsValid();
TKUnit.assertEqual(this.testView.getChildAt(0)._getCurrentLayoutBounds().left, 0, "ActualLeft on Index 0");
TKUnit.assertEqual(this.testView.getChildAt(1)._getCurrentLayoutBounds().left, 100, "ActualLeft on Index 1");
}
public testPaddingLeftAndTop() {
this.testView.removeChildren();
this.testView.paddingLeft = layoutHelper.dp(20);