From 8661d8aecd626f7f57ccbcb735553edc05a2e713 Mon Sep 17 00:00:00 2001 From: xster Date: Thu, 14 Feb 2019 19:19:53 -0800 Subject: [PATCH] Test text paint orders by color (#27983) --- packages/flutter/test/rendering/editable_test.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/flutter/test/rendering/editable_test.dart b/packages/flutter/test/rendering/editable_test.dart index d637174bbb..6840f8e4a4 100644 --- a/packages/flutter/test/rendering/editable_test.dart +++ b/packages/flutter/test/rendering/editable_test.dart @@ -175,7 +175,7 @@ void main() { backgroundCursorColor: Colors.grey, selectionColor: Colors.black, textDirection: TextDirection.ltr, - cursorColor: const Color.fromARGB(0xFF, 0xFF, 0x00, 0x00), + cursorColor: Colors.red, offset: ViewportOffset.zero(), textSelectionDelegate: delegate, text: const TextSpan( @@ -196,8 +196,8 @@ void main() { expect( editable, paints - // This is a big selection rectangle, not the cursor. - ..rect(color: Colors.black, rect: Rect.fromLTWH(0, 0, 30, 10)) + // Check that it's the black selection box, not the red cursor. + ..rect(color: Colors.black) ..paragraph(), ); @@ -235,7 +235,8 @@ void main() { editable, paints ..paragraph() - ..rect(color: Colors.red[500], rect: Rect.fromLTWH(20, 2, 1, 6)), + // Red collapsed cursor is painted, not a selection box. + ..rect(color: Colors.red[500]), ); // There is exactly one rect paint (0 selection, 1 cursor). @@ -248,7 +249,7 @@ void main() { editable, // The paint order is now flipped. paints - ..rect(color: Colors.red[500], rect: Rect.fromLTWH(20, 2, 1, 6)) + ..rect(color: Colors.red[500]) ..paragraph(), ); expect(editable, paintsExactlyCountTimes(#drawRect, 1));