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
a67a2f62
Unverified
Commit
a67a2f62
authored
Jan 08, 2019
by
Mehmet Fidanboylu
Committed by
GitHub
Jan 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract TestBorder into a utility file (#25888)
parent
8049893f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
33 deletions
+36
-33
material_test.dart
packages/flutter/test/material/material_test.dart
+1
-1
clip_test.dart
packages/flutter/test/widgets/clip_test.dart
+1
-1
shape_decoration_test.dart
packages/flutter/test/widgets/shape_decoration_test.dart
+1
-31
test_border.dart
packages/flutter/test/widgets/test_border.dart
+33
-0
No files found.
packages/flutter/test/material/material_test.dart
View file @
a67a2f62
...
...
@@ -8,7 +8,7 @@ import 'package:flutter/rendering.dart';
import
'package:flutter_test/flutter_test.dart'
;
import
'../rendering/mock_canvas.dart'
;
import
'../widgets/
shape_decoration_test
.dart'
show
TestBorder
;
import
'../widgets/
test_border
.dart'
show
TestBorder
;
class
NotifyMaterial
extends
StatelessWidget
{
@override
...
...
packages/flutter/test/widgets/clip_test.dart
View file @
a67a2f62
...
...
@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
import
'package:flutter/rendering.dart'
;
import
'../rendering/mock_canvas.dart'
;
import
'
shape_decoration_test
.dart'
show
TestBorder
;
import
'
test_border
.dart'
show
TestBorder
;
final
List
<
String
>
log
=
<
String
>[];
...
...
packages/flutter/test/widgets/shape_decoration_test.dart
View file @
a67a2f62
...
...
@@ -11,6 +11,7 @@ import 'package:flutter_test/flutter_test.dart';
import
'../painting/image_data.dart'
;
import
'../painting/mocks_for_image_cache.dart'
;
import
'../rendering/mock_canvas.dart'
;
import
'test_border.dart'
show
TestBorder
;
Future
<
void
>
main
()
async
{
final
ui
.
Image
rawImage
=
await
decodeImageFromList
(
Uint8List
.
fromList
(
kTransparentImage
));
...
...
@@ -104,34 +105,3 @@ Future<void> main() async {
);
});
}
typedef
Logger
=
void
Function
(
String
caller
);
class
TestBorder
extends
ShapeBorder
{
const
TestBorder
(
this
.
onLog
)
:
assert
(
onLog
!=
null
);
final
Logger
onLog
;
@override
EdgeInsetsGeometry
get
dimensions
=>
const
EdgeInsetsDirectional
.
only
(
start:
1.0
);
@override
ShapeBorder
scale
(
double
t
)
=>
TestBorder
(
onLog
);
@override
Path
getInnerPath
(
Rect
rect
,
{
TextDirection
textDirection
})
{
onLog
(
'getInnerPath
$rect
$textDirection
'
);
return
Path
();
}
@override
Path
getOuterPath
(
Rect
rect
,
{
TextDirection
textDirection
})
{
onLog
(
'getOuterPath
$rect
$textDirection
'
);
return
Path
();
}
@override
void
paint
(
Canvas
canvas
,
Rect
rect
,
{
TextDirection
textDirection
})
{
onLog
(
'paint
$rect
$textDirection
'
);
}
}
packages/flutter/test/widgets/test_border.dart
0 → 100644
View file @
a67a2f62
import
'package:flutter/material.dart'
;
typedef
Logger
=
void
Function
(
String
caller
);
class
TestBorder
extends
ShapeBorder
{
const
TestBorder
(
this
.
onLog
)
:
assert
(
onLog
!=
null
);
final
Logger
onLog
;
@override
EdgeInsetsGeometry
get
dimensions
=>
const
EdgeInsetsDirectional
.
only
(
start:
1.0
);
@override
ShapeBorder
scale
(
double
t
)
=>
TestBorder
(
onLog
);
@override
Path
getInnerPath
(
Rect
rect
,
{
TextDirection
textDirection
})
{
onLog
(
'getInnerPath
$rect
$textDirection
'
);
return
Path
();
}
@override
Path
getOuterPath
(
Rect
rect
,
{
TextDirection
textDirection
})
{
onLog
(
'getOuterPath
$rect
$textDirection
'
);
return
Path
();
}
@override
void
paint
(
Canvas
canvas
,
Rect
rect
,
{
TextDirection
textDirection
})
{
onLog
(
'paint
$rect
$textDirection
'
);
}
}
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