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
390c7ce2
Commit
390c7ce2
authored
May 23, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use debugPrint instead of print in test lib (#4122)
parent
b5c6da10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
widget_tester.dart
packages/flutter_test/lib/src/widget_tester.dart
+7
-7
No files found.
packages/flutter_test/lib/src/widget_tester.dart
View file @
390c7ce2
...
@@ -215,7 +215,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
...
@@ -215,7 +215,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
int
numberOfWithTexts
=
0
;
int
numberOfWithTexts
=
0
;
int
numberOfTypes
=
0
;
int
numberOfTypes
=
0
;
int
totalNumber
=
0
;
int
totalNumber
=
0
;
p
rint
(
'Some possible finders for the widgets at
${binding.globalToLocal(event.position)}
:'
);
debugP
rint
(
'Some possible finders for the widgets at
${binding.globalToLocal(event.position)}
:'
);
for
(
Element
element
in
candidates
)
{
for
(
Element
element
in
candidates
)
{
if
(
totalNumber
>
10
)
if
(
totalNumber
>
10
)
break
;
break
;
...
@@ -227,7 +227,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
...
@@ -227,7 +227,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
final
Iterable
<
Element
>
matches
=
find
.
text
(
widget
.
data
).
evaluate
();
final
Iterable
<
Element
>
matches
=
find
.
text
(
widget
.
data
).
evaluate
();
descendantText
=
widget
.
data
;
descendantText
=
widget
.
data
;
if
(
matches
.
length
==
1
)
{
if
(
matches
.
length
==
1
)
{
p
rint
(
' find.text(
\'
${widget.data}
\'
)'
);
debugP
rint
(
' find.text(
\'
${widget.data}
\'
)'
);
continue
;
continue
;
}
}
}
}
...
@@ -245,7 +245,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
...
@@ -245,7 +245,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
if
(
keyLabel
!=
null
)
{
if
(
keyLabel
!=
null
)
{
final
Iterable
<
Element
>
matches
=
find
.
byKey
(
key
).
evaluate
();
final
Iterable
<
Element
>
matches
=
find
.
byKey
(
key
).
evaluate
();
if
(
matches
.
length
==
1
)
{
if
(
matches
.
length
==
1
)
{
p
rint
(
' find.byKey(
$keyLabel
)'
);
debugP
rint
(
' find.byKey(
$keyLabel
)'
);
continue
;
continue
;
}
}
}
}
...
@@ -255,7 +255,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
...
@@ -255,7 +255,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
if
(
numberOfTypes
<
5
)
{
if
(
numberOfTypes
<
5
)
{
final
Iterable
<
Element
>
matches
=
find
.
byType
(
element
.
widget
.
runtimeType
).
evaluate
();
final
Iterable
<
Element
>
matches
=
find
.
byType
(
element
.
widget
.
runtimeType
).
evaluate
();
if
(
matches
.
length
==
1
)
{
if
(
matches
.
length
==
1
)
{
p
rint
(
' find.byType(
${element.widget.runtimeType}
)'
);
debugP
rint
(
' find.byType(
${element.widget.runtimeType}
)'
);
numberOfTypes
+=
1
;
numberOfTypes
+=
1
;
continue
;
continue
;
}
}
...
@@ -264,7 +264,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
...
@@ -264,7 +264,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
if
(
descendantText
!=
null
&&
numberOfWithTexts
<
5
)
{
if
(
descendantText
!=
null
&&
numberOfWithTexts
<
5
)
{
final
Iterable
<
Element
>
matches
=
find
.
widgetWithText
(
element
.
widget
.
runtimeType
,
descendantText
).
evaluate
();
final
Iterable
<
Element
>
matches
=
find
.
widgetWithText
(
element
.
widget
.
runtimeType
,
descendantText
).
evaluate
();
if
(
matches
.
length
==
1
)
{
if
(
matches
.
length
==
1
)
{
p
rint
(
' find.widgetWithText(
${element.widget.runtimeType}
,
\'
$descendantText
\'
)'
);
debugP
rint
(
' find.widgetWithText(
${element.widget.runtimeType}
,
\'
$descendantText
\'
)'
);
numberOfWithTexts
+=
1
;
numberOfWithTexts
+=
1
;
continue
;
continue
;
}
}
...
@@ -274,7 +274,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
...
@@ -274,7 +274,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
if
(!
_isPrivate
(
element
.
runtimeType
))
{
if
(!
_isPrivate
(
element
.
runtimeType
))
{
final
Iterable
<
Element
>
matches
=
find
.
byElementType
(
element
.
runtimeType
).
evaluate
();
final
Iterable
<
Element
>
matches
=
find
.
byElementType
(
element
.
runtimeType
).
evaluate
();
if
(
matches
.
length
==
1
)
{
if
(
matches
.
length
==
1
)
{
p
rint
(
' find.byElementType(
${element.runtimeType}
)'
);
debugP
rint
(
' find.byElementType(
${element.runtimeType}
)'
);
continue
;
continue
;
}
}
}
}
...
@@ -282,7 +282,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
...
@@ -282,7 +282,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher {
totalNumber
-=
1
;
// if we got here, we didn't actually find something to say about it
totalNumber
-=
1
;
// if we got here, we didn't actually find something to say about it
}
}
if
(
totalNumber
==
0
)
if
(
totalNumber
==
0
)
p
rint
(
' <could not come up with any unique finders>'
);
debugP
rint
(
' <could not come up with any unique finders>'
);
}
}
}
}
...
...
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