Unverified Commit 31600c82 authored by Matan Lurey's avatar Matan Lurey Committed by GitHub

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.
parent d7a3a682
......@@ -450,6 +450,13 @@ void main() {
});
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();
expect(s1.backgroundColor, isNull);
expect(s1.toString(), 'TextStyle(<all styles inherited>)');
......@@ -459,7 +466,16 @@ void main() {
expect(s2.toString(), 'TextStyle(inherit: true, backgroundColor: Color(0xff00ff00))');
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', () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment