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
f16dea29
Commit
f16dea29
authored
Feb 10, 2017
by
Alexandre Ardhuin
Committed by
Adam Barth
Feb 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefer const contructors in packages/flutter_driver (#8056)
parent
b246c5e7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
19 deletions
+19
-19
common.dart
packages/flutter_driver/lib/src/common.dart
+2
-2
driver.dart
packages/flutter_driver/lib/src/driver.dart
+1
-1
timeline_summary.dart
packages/flutter_driver/lib/src/timeline_summary.dart
+1
-1
flutter_driver_test.dart
packages/flutter_driver/test/flutter_driver_test.dart
+6
-6
retry_test.dart
packages/flutter_driver/test/src/retry_test.dart
+9
-9
No files found.
packages/flutter_driver/lib/src/common.dart
View file @
f16dea29
...
...
@@ -11,7 +11,7 @@ import 'package:file/memory.dart';
/// The file system implementation used by this library.
///
/// See [useMemoryFileSystemForTesting] and [restoreFileSystem].
FileSystem
fs
=
new
LocalFileSystem
();
FileSystem
fs
=
const
LocalFileSystem
();
/// Overrides the file system so it can be tested without hitting the hard
/// drive.
...
...
@@ -21,7 +21,7 @@ void useMemoryFileSystemForTesting() {
/// Restores the file system to the default local file system implementation.
void
restoreFileSystem
(
)
{
fs
=
new
LocalFileSystem
();
fs
=
const
LocalFileSystem
();
}
/// Flutter Driver test ouputs directory.
...
...
packages/flutter_driver/lib/src/driver.dart
View file @
f16dea29
...
...
@@ -157,7 +157,7 @@ class FlutterDriver {
isolate
.
pauseEvent
is
!
VMPauseExceptionEvent
&&
isolate
.
pauseEvent
is
!
VMPauseInterruptedEvent
&&
isolate
.
pauseEvent
is
!
VMResumeEvent
)
{
await
new
Future
<
Null
>.
delayed
(
new
Duration
(
milliseconds:
300
));
await
new
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
300
));
isolate
=
await
vm
.
isolates
.
first
.
loadRunnable
();
}
...
...
packages/flutter_driver/lib/src/timeline_summary.dart
View file @
f16dea29
...
...
@@ -12,7 +12,7 @@ import 'package:path/path.dart' as path;
import
'common.dart'
;
import
'timeline.dart'
;
final
JsonEncoder
_prettyEncoder
=
new
JsonEncoder
.
withIndent
(
' '
);
final
JsonEncoder
_prettyEncoder
=
const
JsonEncoder
.
withIndent
(
' '
);
/// The maximum amount of time considered safe to spend for a frame's build
/// phase. Anything past that is in the danger of missing the frame as 60FPS.
...
...
packages/flutter_driver/test/flutter_driver_test.dart
View file @
f16dea29
...
...
@@ -120,7 +120,7 @@ void main() {
group
(
'ByValueKey'
,
()
{
test
(
'restricts value types'
,
()
async
{
expect
(()
=>
find
.
byValueKey
(
null
),
throwsA
(
new
isInstanceOf
<
DriverError
>()));
throwsA
(
const
isInstanceOf
<
DriverError
>()));
});
test
(
'finds by ValueKey'
,
()
async
{
...
...
@@ -140,7 +140,7 @@ void main() {
group
(
'tap'
,
()
{
test
(
'requires a target reference'
,
()
async
{
expect
(
driver
.
tap
(
null
),
throwsA
(
new
isInstanceOf
<
DriverError
>()));
expect
(
driver
.
tap
(
null
),
throwsA
(
const
isInstanceOf
<
DriverError
>()));
});
test
(
'sends the tap command'
,
()
async
{
...
...
@@ -159,7 +159,7 @@ void main() {
group
(
'getText'
,
()
{
test
(
'requires a target reference'
,
()
async
{
expect
(
driver
.
getText
(
null
),
throwsA
(
new
isInstanceOf
<
DriverError
>()));
expect
(
driver
.
getText
(
null
),
throwsA
(
const
isInstanceOf
<
DriverError
>()));
});
test
(
'sends the getText command'
,
()
async
{
...
...
@@ -182,7 +182,7 @@ void main() {
group
(
'waitFor'
,
()
{
test
(
'requires a target reference'
,
()
async
{
expect
(
driver
.
waitFor
(
null
),
throwsA
(
new
isInstanceOf
<
DriverError
>()));
expect
(
driver
.
waitFor
(
null
),
throwsA
(
const
isInstanceOf
<
DriverError
>()));
});
test
(
'sends the waitFor command'
,
()
async
{
...
...
@@ -195,7 +195,7 @@ void main() {
});
return
makeMockResponse
(<
String
,
dynamic
>{});
});
await
driver
.
waitFor
(
find
.
byTooltip
(
'foo'
),
timeout:
new
Duration
(
seconds:
1
));
await
driver
.
waitFor
(
find
.
byTooltip
(
'foo'
),
timeout:
const
Duration
(
seconds:
1
));
});
});
...
...
@@ -289,7 +289,7 @@ void main() {
return
new
Completer
<
Map
<
String
,
dynamic
>>().
future
;
});
try
{
await
driver
.
waitFor
(
find
.
byTooltip
(
'foo'
),
timeout:
new
Duration
(
milliseconds:
100
));
await
driver
.
waitFor
(
find
.
byTooltip
(
'foo'
),
timeout:
const
Duration
(
milliseconds:
100
));
fail
(
'expected an exception'
);
}
catch
(
error
)
{
expect
(
error
is
DriverError
,
isTrue
);
...
...
packages/flutter_driver/test/src/retry_test.dart
View file @
f16dea29
...
...
@@ -38,13 +38,13 @@ void main() {
return
retryCount
;
}
},
new
Duration
(
milliseconds:
30
),
new
Duration
(
milliseconds:
10
)
const
Duration
(
milliseconds:
30
),
const
Duration
(
milliseconds:
10
)
),
completion
(
2
)
);
fakeAsync
.
elapse
(
new
Duration
(
milliseconds:
50
));
fakeAsync
.
elapse
(
const
Duration
(
milliseconds:
50
));
// Check that we didn't retry more times than necessary
expect
(
retryCount
,
2
);
...
...
@@ -60,14 +60,14 @@ void main() {
// that `retry` keeps trying until the counter reaches 2.
retry
(
()
async
=>
retryCount
++,
new
Duration
(
milliseconds:
30
),
new
Duration
(
milliseconds:
10
),
const
Duration
(
milliseconds:
30
),
const
Duration
(
milliseconds:
10
),
predicate:
(
int
value
)
=>
value
==
2
),
completion
(
2
)
);
fakeAsync
.
elapse
(
new
Duration
(
milliseconds:
50
));
fakeAsync
.
elapse
(
const
Duration
(
milliseconds:
50
));
});
});
...
...
@@ -83,15 +83,15 @@ void main() {
retryCount
++;
throw
'error'
;
},
new
Duration
(
milliseconds:
7
),
new
Duration
(
milliseconds:
2
)
const
Duration
(
milliseconds:
7
),
const
Duration
(
milliseconds:
2
)
).
catchError
((
dynamic
error
,
dynamic
stackTrace
)
{
timedOut
=
true
;
lastError
=
error
;
lastStackTrace
=
stackTrace
;
});
fakeAsync
.
elapse
(
new
Duration
(
milliseconds:
10
));
fakeAsync
.
elapse
(
const
Duration
(
milliseconds:
10
));
expect
(
timedOut
,
isTrue
);
expect
(
lastError
,
'error'
);
...
...
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