Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
bf8313f8
Unverified
Commit
bf8313f8
authored
Dec 03, 2020
by
Jia Hao
Committed by
GitHub
Dec 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for intrinsic size checks (#71539)
parent
746056a5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
dynamic_intrinsics_test.dart
packages/flutter/test/rendering/dynamic_intrinsics_test.dart
+41
-0
No files found.
packages/flutter/test/rendering/dynamic_intrinsics_test.dart
View file @
bf8313f8
...
@@ -83,4 +83,45 @@ void main() {
...
@@ -83,4 +83,45 @@ void main() {
pumpFrame
();
pumpFrame
();
expect
(
root
.
size
,
equals
(
inner
.
size
));
expect
(
root
.
size
,
equals
(
inner
.
size
));
});
});
test
(
'When RenderObject.debugCheckingIntrinsics is true, parent returns correct intrinsics'
,
()
{
RenderObject
.
debugCheckingIntrinsics
=
true
;
try
{
RenderParentSize
parent
;
RenderFixedSize
inner
;
layout
(
RenderIntrinsicSize
(
child:
parent
=
RenderParentSize
(
child:
inner
=
RenderFixedSize
()
)
),
constraints:
const
BoxConstraints
(
minWidth:
0.0
,
minHeight:
0.0
,
maxWidth:
1000.0
,
maxHeight:
1000.0
,
),
);
_expectIntrinsicDimensions
(
parent
,
100
);
inner
.
grow
();
pumpFrame
();
_expectIntrinsicDimensions
(
parent
,
200
);
}
finally
{
RenderObject
.
debugCheckingIntrinsics
=
false
;
}
});
}
/// Asserts that all unbounded intrinsic dimensions for [object] match
/// [dimension].
void
_expectIntrinsicDimensions
(
RenderBox
object
,
double
dimension
)
{
expect
(
object
.
getMinIntrinsicWidth
(
double
.
infinity
),
equals
(
dimension
));
expect
(
object
.
getMaxIntrinsicWidth
(
double
.
infinity
),
equals
(
dimension
));
expect
(
object
.
getMinIntrinsicHeight
(
double
.
infinity
),
equals
(
dimension
));
expect
(
object
.
getMaxIntrinsicHeight
(
double
.
infinity
),
equals
(
dimension
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment