Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
2f122f7d
Unverified
Commit
2f122f7d
authored
May 11, 2018
by
Jason Simmons
Committed by
GitHub
May 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a golden image test for centered text (#17517)
parent
ef20f726
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
1 deletion
+63
-1
goldens.version
bin/internal/goldens.version
+1
-1
text_golden_test.dart
packages/flutter/test/widgets/text_golden_test.dart
+62
-0
No files found.
bin/internal/goldens.version
View file @
2f122f7d
ed07132380cd2db6dd664be1479c5b89579e3304
df3f713cc47fc4e919d1c5cf52c0543424c26c09
packages/flutter/test/widgets/text_golden_test.dart
0 → 100644
View file @
2f122f7d
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:io'
show
Platform
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/widgets.dart'
;
void
main
(
)
{
testWidgets
(
'Centered text'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
new
RepaintBoundary
(
child:
new
Center
(
child:
new
Container
(
width:
200.0
,
height:
100.0
,
decoration:
const
BoxDecoration
(
color:
const
Color
(
0xff00ff00
),
),
child:
const
Text
(
'Hello'
,
textDirection:
TextDirection
.
ltr
,
textAlign:
TextAlign
.
center
,
style:
const
TextStyle
(
color:
const
Color
(
0xffff0000
)),
),
),
),
),
);
await
expectLater
(
find
.
byType
(
Container
),
matchesGoldenFile
(
'text_golden.Centered.png'
),
skip:
!
Platform
.
isLinux
,
);
await
tester
.
pumpWidget
(
new
RepaintBoundary
(
child:
new
Center
(
child:
new
Container
(
width:
200.0
,
height:
100.0
,
decoration:
const
BoxDecoration
(
color:
const
Color
(
0xff00ff00
),
),
child:
const
Text
(
'Hello world how are you today'
,
textDirection:
TextDirection
.
ltr
,
textAlign:
TextAlign
.
center
,
style:
const
TextStyle
(
color:
const
Color
(
0xffff0000
)),
),
),
),
),
);
await
expectLater
(
find
.
byType
(
Container
),
matchesGoldenFile
(
'text_golden.Centered.wrap.png'
),
skip:
!
Platform
.
isLinux
,
);
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment