Forward-fix a test that will break with an engine roll. (#133619)
See https://github.com/flutter/engine/pull/44705 where it fails a framework smoke test. Partial work towards https://github.com/flutter/flutter/issues/112498.
This commit is contained in:
parent
d7a3a68275
commit
31600c829e
@ -450,6 +450,13 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('backgroundColor', () {
|
test('backgroundColor', () {
|
||||||
|
// TODO(matanlurey): Remove when https://github.com/flutter/engine/pull/44705 rolls into the framework.
|
||||||
|
// Currently, dithering is disabled by default, but it's about to be flipped (enabled by default),
|
||||||
|
// and deprecated. This avoids #44705 causing a breakage in this test.
|
||||||
|
//
|
||||||
|
// ignore: deprecated_member_use
|
||||||
|
Paint.enableDithering = true;
|
||||||
|
|
||||||
const TextStyle s1 = TextStyle();
|
const TextStyle s1 = TextStyle();
|
||||||
expect(s1.backgroundColor, isNull);
|
expect(s1.backgroundColor, isNull);
|
||||||
expect(s1.toString(), 'TextStyle(<all styles inherited>)');
|
expect(s1.toString(), 'TextStyle(<all styles inherited>)');
|
||||||
@ -459,7 +466,16 @@ void main() {
|
|||||||
expect(s2.toString(), 'TextStyle(inherit: true, backgroundColor: Color(0xff00ff00))');
|
expect(s2.toString(), 'TextStyle(inherit: true, backgroundColor: Color(0xff00ff00))');
|
||||||
|
|
||||||
final ui.TextStyle ts2 = s2.getTextStyle();
|
final ui.TextStyle ts2 = s2.getTextStyle();
|
||||||
expect(ts2.toString(), contains('background: Paint(Color(0xff00ff00))'));
|
|
||||||
|
// TODO(matanlurey): Remove when https://github.com/flutter/flutter/issues/133698 is resolved.
|
||||||
|
// There are 5+ implementations of Paint, so we should either align the toString() or stop
|
||||||
|
// testing it, IMO.
|
||||||
|
if (kIsWeb) {
|
||||||
|
// The web implementation never includes "dither: ..." as a property.
|
||||||
|
expect(ts2.toString(), contains('background: Paint(Color(0xff00ff00))'));
|
||||||
|
} else {
|
||||||
|
expect(ts2.toString(), contains('background: Paint(Color(0xff00ff00); dither: true)'));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('TextStyle background and backgroundColor combos', () {
|
test('TextStyle background and backgroundColor combos', () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user