Unverified Commit 980c8a73 authored by liyuqian's avatar liyuqian Committed by GitHub

Add golden test for clipping (#20750)

For #20483
parent 09fec4c5
6c45fafdf5e3231406e1921285767f6ca8c05d6e d0800cf4170e77682173c19703f605c6795e0ff8
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:io';
import 'dart:ui'; import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
...@@ -408,4 +409,33 @@ void main() { ...@@ -408,4 +409,33 @@ void main() {
expect(shortFAB, findsNothing); expect(shortFAB, findsNothing);
expect(helloWorld, findsOneWidget); expect(helloWorld, findsOneWidget);
}); });
// This test prevents https://github.com/flutter/flutter/issues/20483
testWidgets('Floating Action Button clips ink splash and highlight', (WidgetTester tester) async {
final GlobalKey key = new GlobalKey();
await tester.pumpWidget(
new MaterialApp(
home: new Scaffold(
body: new Center(
child: new RepaintBoundary(
key: key,
child: new FloatingActionButton(
onPressed: () {},
child: const Icon(Icons.add),
),
),
),
),
),
);
await tester.press(find.byKey(key));
await tester.pump();
await tester.pump(const Duration(milliseconds: 1000));
await expectLater(
find.byKey(key),
matchesGoldenFile('floating_action_button_test.clip.1.png'),
skip: !Platform.isLinux,
);
});
} }
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