Add missing debug vars to debugAssertAllRenderVarsUnset (#91848)

This commit is contained in:
Michael Goderbauer 2021-10-14 15:38:03 -07:00 committed by GitHub
parent ac745b3f75
commit 9570d353b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 1 deletions

View File

@ -238,8 +238,12 @@ bool debugAssertAllRenderVarsUnset(String reason, { bool debugCheckIntrinsicSize
debugPrintMarkNeedsPaintStacks ||
debugPrintLayouts ||
debugCheckIntrinsicSizes != debugCheckIntrinsicSizesOverride ||
debugProfileLayoutsEnabled ||
debugProfilePaintsEnabled ||
debugOnProfilePaint != null) {
debugOnProfilePaint != null ||
debugDisableClipLayers ||
debugDisablePhysicalShapeLayers ||
debugDisableOpacityLayers) {
throw FlutterError(reason);
}
return true;

View File

@ -234,4 +234,28 @@ void main() {
expect(opacityLayer.offset, const Offset(40, 40));
debugDisableOpacityLayers = false;
});
test('debugAssertAllRenderVarsUnset warns when debugProfileLayoutsEnabled set', () {
debugProfileLayoutsEnabled = true;
expect(() => debugAssertAllRenderVarsUnset('ERROR'), throwsFlutterError);
debugProfileLayoutsEnabled = false;
});
test('debugAssertAllRenderVarsUnset warns when debugDisableClipLayers set', () {
debugDisableClipLayers = true;
expect(() => debugAssertAllRenderVarsUnset('ERROR'), throwsFlutterError);
debugDisableClipLayers = false;
});
test('debugAssertAllRenderVarsUnset warns when debugDisablePhysicalShapeLayers set', () {
debugDisablePhysicalShapeLayers = true;
expect(() => debugAssertAllRenderVarsUnset('ERROR'), throwsFlutterError);
debugDisablePhysicalShapeLayers = false;
});
test('debugAssertAllRenderVarsUnset warns when debugDisableOpacityLayers set', () {
debugDisableOpacityLayers = true;
expect(() => debugAssertAllRenderVarsUnset('ERROR'), throwsFlutterError);
debugDisableOpacityLayers = false;
});
}