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
c2363c88
Commit
c2363c88
authored
May 04, 2016
by
Phil Quitslund
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3727 from pq/annotate_literals
Literals get type annotations.
parents
1e093701
bcede8df
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
54 additions
and
54 deletions
+54
-54
driver.dart
packages/flutter_driver/lib/src/driver.dart
+2
-2
find.dart
packages/flutter_driver/lib/src/find.dart
+5
-5
gesture.dart
packages/flutter_driver/lib/src/gesture.dart
+3
-3
health.dart
packages/flutter_driver/lib/src/health.dart
+2
-2
matcher_util.dart
packages/flutter_driver/lib/src/matcher_util.dart
+1
-1
flutter_driver_test.dart
packages/flutter_driver/test/flutter_driver_test.dart
+12
-12
timeline_summary_test.dart
packages/flutter_driver/test/src/timeline_summary_test.dart
+16
-16
timeline_test.dart
packages/flutter_driver/test/src/timeline_test.dart
+6
-6
nine_slice_sprite.dart
packages/flutter_sprites/lib/src/nine_slice_sprite.dart
+1
-1
action_test.dart
packages/flutter_sprites/test/action_test.dart
+2
-2
constraint_test.dart
packages/flutter_sprites/test/constraint_test.dart
+4
-4
No files found.
packages/flutter_driver/lib/src/driver.dart
View file @
c2363c88
...
@@ -252,7 +252,7 @@ class FlutterDriver {
...
@@ -252,7 +252,7 @@ class FlutterDriver {
Future
<
Null
>
startTracing
({
List
<
TracingCategory
>
categories:
_defaultCategories
})
async
{
Future
<
Null
>
startTracing
({
List
<
TracingCategory
>
categories:
_defaultCategories
})
async
{
assert
(
categories
!=
null
&&
categories
.
length
>
0
);
assert
(
categories
!=
null
&&
categories
.
length
>
0
);
try
{
try
{
await
_peer
.
sendRequest
(
_kSetVMTimelineFlagsMethod
,
{
await
_peer
.
sendRequest
(
_kSetVMTimelineFlagsMethod
,
<
String
,
String
>
{
'recordedStreams'
:
_tracingCategoriesToString
(
categories
)
'recordedStreams'
:
_tracingCategoriesToString
(
categories
)
});
});
return
null
;
return
null
;
...
@@ -268,7 +268,7 @@ class FlutterDriver {
...
@@ -268,7 +268,7 @@ class FlutterDriver {
/// Stops recording performance traces and downloads the timeline.
/// Stops recording performance traces and downloads the timeline.
Future
<
Timeline
>
stopTracingAndDownloadTimeline
()
async
{
Future
<
Timeline
>
stopTracingAndDownloadTimeline
()
async
{
try
{
try
{
await
_peer
.
sendRequest
(
_kSetVMTimelineFlagsMethod
,
{
'recordedStreams'
:
'[]'
});
await
_peer
.
sendRequest
(
_kSetVMTimelineFlagsMethod
,
<
String
,
String
>
{
'recordedStreams'
:
'[]'
});
return
new
Timeline
.
fromJson
(
await
_peer
.
sendRequest
(
_kGetVMTimelineMethod
));
return
new
Timeline
.
fromJson
(
await
_peer
.
sendRequest
(
_kGetVMTimelineMethod
));
}
catch
(
error
,
stackTrace
)
{
}
catch
(
error
,
stackTrace
)
{
throw
new
DriverError
(
throw
new
DriverError
(
...
...
packages/flutter_driver/lib/src/find.dart
View file @
c2363c88
...
@@ -91,7 +91,7 @@ abstract class SerializableFinder {
...
@@ -91,7 +91,7 @@ abstract class SerializableFinder {
throw
new
DriverError
(
'Unsupported search specification type
$finderType
'
);
throw
new
DriverError
(
'Unsupported search specification type
$finderType
'
);
}
}
Map
<
String
,
String
>
serialize
()
=>
{
Map
<
String
,
String
>
serialize
()
=>
<
String
,
String
>
{
'finderType'
:
finderType
,
'finderType'
:
finderType
,
};
};
}
}
...
@@ -107,7 +107,7 @@ class ByTooltipMessage extends SerializableFinder {
...
@@ -107,7 +107,7 @@ class ByTooltipMessage extends SerializableFinder {
final
String
text
;
final
String
text
;
@override
@override
Map
<
String
,
String
>
serialize
()
=>
super
.
serialize
()..
addAll
({
Map
<
String
,
String
>
serialize
()
=>
super
.
serialize
()..
addAll
(
<
String
,
String
>
{
'text'
:
text
,
'text'
:
text
,
});
});
...
@@ -126,7 +126,7 @@ class ByText extends SerializableFinder {
...
@@ -126,7 +126,7 @@ class ByText extends SerializableFinder {
final
String
text
;
final
String
text
;
@override
@override
Map
<
String
,
String
>
serialize
()
=>
super
.
serialize
()..
addAll
({
Map
<
String
,
String
>
serialize
()
=>
super
.
serialize
()..
addAll
(
<
String
,
String
>
{
'text'
:
text
,
'text'
:
text
,
});
});
...
@@ -160,7 +160,7 @@ class ByValueKey extends SerializableFinder {
...
@@ -160,7 +160,7 @@ class ByValueKey extends SerializableFinder {
final
String
keyValueType
;
final
String
keyValueType
;
@override
@override
Map
<
String
,
String
>
serialize
()
=>
super
.
serialize
()..
addAll
({
Map
<
String
,
String
>
serialize
()
=>
super
.
serialize
()..
addAll
(
<
String
,
String
>
{
'keyValueString'
:
keyValueString
,
'keyValueString'
:
keyValueString
,
'keyValueType'
:
keyValueType
,
'keyValueType'
:
keyValueType
,
});
});
...
@@ -205,7 +205,7 @@ class GetTextResult extends Result {
...
@@ -205,7 +205,7 @@ class GetTextResult extends Result {
}
}
@override
@override
Map
<
String
,
dynamic
>
toJson
()
=>
{
Map
<
String
,
dynamic
>
toJson
()
=>
<
String
,
String
>
{
'text'
:
text
,
'text'
:
text
,
};
};
}
}
packages/flutter_driver/lib/src/gesture.dart
View file @
c2363c88
...
@@ -25,7 +25,7 @@ class TapResult extends Result {
...
@@ -25,7 +25,7 @@ class TapResult extends Result {
}
}
@override
@override
Map
<
String
,
dynamic
>
toJson
()
=>
{};
Map
<
String
,
dynamic
>
toJson
()
=>
<
String
,
dynamic
>
{};
}
}
...
@@ -65,7 +65,7 @@ class Scroll extends CommandWithTarget {
...
@@ -65,7 +65,7 @@ class Scroll extends CommandWithTarget {
final
int
frequency
;
final
int
frequency
;
@override
@override
Map
<
String
,
String
>
serialize
()
=>
super
.
serialize
()..
addAll
({
Map
<
String
,
String
>
serialize
()
=>
super
.
serialize
()..
addAll
(
<
String
,
String
>
{
'dx'
:
'
$dx
'
,
'dx'
:
'
$dx
'
,
'dy'
:
'
$dy
'
,
'dy'
:
'
$dy
'
,
'duration'
:
'
${duration.inMicroseconds}
'
,
'duration'
:
'
${duration.inMicroseconds}
'
,
...
@@ -92,5 +92,5 @@ class ScrollResult extends Result {
...
@@ -92,5 +92,5 @@ class ScrollResult extends Result {
}
}
@override
@override
Map
<
String
,
dynamic
>
toJson
()
=>
{};
Map
<
String
,
dynamic
>
toJson
()
=>
<
String
,
dynamic
>
{};
}
}
packages/flutter_driver/lib/src/health.dart
View file @
c2363c88
...
@@ -13,7 +13,7 @@ class GetHealth implements Command {
...
@@ -13,7 +13,7 @@ class GetHealth implements Command {
static
GetHealth
deserialize
(
Map
<
String
,
String
>
json
)
=>
new
GetHealth
();
static
GetHealth
deserialize
(
Map
<
String
,
String
>
json
)
=>
new
GetHealth
();
@override
@override
Map
<
String
,
String
>
serialize
()
=>
const
{};
Map
<
String
,
String
>
serialize
()
=>
const
<
String
,
String
>
{};
}
}
/// Application health status.
/// Application health status.
...
@@ -42,7 +42,7 @@ class Health extends Result {
...
@@ -42,7 +42,7 @@ class Health extends Result {
final
HealthStatus
status
;
final
HealthStatus
status
;
@override
@override
Map
<
String
,
dynamic
>
toJson
()
=>
{
Map
<
String
,
dynamic
>
toJson
()
=>
<
String
,
dynamic
>
{
'status'
:
_healthStatusIndex
.
toSimpleName
(
status
)
'status'
:
_healthStatusIndex
.
toSimpleName
(
status
)
};
};
}
}
packages/flutter_driver/lib/src/matcher_util.dart
View file @
c2363c88
...
@@ -6,7 +6,7 @@ import 'package:matcher/matcher.dart';
...
@@ -6,7 +6,7 @@ import 'package:matcher/matcher.dart';
/// Matches [value] against the [matcher].
/// Matches [value] against the [matcher].
MatchResult
match
(
dynamic
value
,
Matcher
matcher
)
{
MatchResult
match
(
dynamic
value
,
Matcher
matcher
)
{
Map
<
dynamic
,
dynamic
>
matchState
=
{};
Map
<
dynamic
,
dynamic
>
matchState
=
<
dynamic
,
dynamic
>
{};
if
(
matcher
.
matches
(
value
,
matchState
))
{
if
(
matcher
.
matches
(
value
,
matchState
))
{
return
new
MatchResult
.
_matched
();
return
new
MatchResult
.
_matched
();
}
else
{
}
else
{
...
...
packages/flutter_driver/test/flutter_driver_test.dart
View file @
c2363c88
...
@@ -32,7 +32,7 @@ void main() {
...
@@ -32,7 +32,7 @@ void main() {
mockVM
=
new
MockVM
();
mockVM
=
new
MockVM
();
mockIsolate
=
new
MockIsolate
();
mockIsolate
=
new
MockIsolate
();
when
(
mockClient
.
getVM
()).
thenReturn
(
mockVM
);
when
(
mockClient
.
getVM
()).
thenReturn
(
mockVM
);
when
(
mockVM
.
isolates
).
thenReturn
([
mockIsolate
]);
when
(
mockVM
.
isolates
).
thenReturn
(
<
VMRunnableIsolate
>
[
mockIsolate
]);
when
(
mockIsolate
.
loadRunnable
()).
thenReturn
(
mockIsolate
);
when
(
mockIsolate
.
loadRunnable
()).
thenReturn
(
mockIsolate
);
when
(
mockIsolate
.
invokeExtension
(
any
,
any
))
when
(
mockIsolate
.
invokeExtension
(
any
,
any
))
.
thenReturn
(
new
Future
<
Map
<
String
,
dynamic
>>.
value
(<
String
,
String
>{
'status'
:
'ok'
}));
.
thenReturn
(
new
Future
<
Map
<
String
,
dynamic
>>.
value
(<
String
,
String
>{
'status'
:
'ok'
}));
...
@@ -126,7 +126,7 @@ void main() {
...
@@ -126,7 +126,7 @@ void main() {
test
(
'finds by ValueKey'
,
()
async
{
test
(
'finds by ValueKey'
,
()
async
{
when
(
mockIsolate
.
invokeExtension
(
any
,
any
)).
thenAnswer
((
Invocation
i
)
{
when
(
mockIsolate
.
invokeExtension
(
any
,
any
)).
thenAnswer
((
Invocation
i
)
{
expect
(
i
.
positionalArguments
[
1
],
{
expect
(
i
.
positionalArguments
[
1
],
<
String
,
String
>
{
'command'
:
'tap'
,
'command'
:
'tap'
,
'finderType'
:
'ByValueKey'
,
'finderType'
:
'ByValueKey'
,
'keyValueString'
:
'foo'
,
'keyValueString'
:
'foo'
,
...
@@ -169,7 +169,7 @@ void main() {
...
@@ -169,7 +169,7 @@ void main() {
'keyValueString'
:
'123'
,
'keyValueString'
:
'123'
,
'keyValueType'
:
'int'
'keyValueType'
:
'int'
});
});
return
new
Future
<
Map
<
String
,
dynamic
>>.
value
({
return
new
Future
<
Map
<
String
,
dynamic
>>.
value
(
<
String
,
String
>
{
'text'
:
'hello'
'text'
:
'hello'
});
});
});
});
...
@@ -191,7 +191,7 @@ void main() {
...
@@ -191,7 +191,7 @@ void main() {
'text'
:
'foo'
,
'text'
:
'foo'
,
'timeout'
:
'1000'
,
'timeout'
:
'1000'
,
});
});
return
new
Future
<
Map
<
String
,
dynamic
>>.
value
({});
return
new
Future
<
Map
<
String
,
dynamic
>>.
value
(
<
String
,
dynamic
>
{});
});
});
await
driver
.
waitFor
(
find
.
byTooltip
(
'foo'
),
timeout:
new
Duration
(
seconds:
1
));
await
driver
.
waitFor
(
find
.
byTooltip
(
'foo'
),
timeout:
new
Duration
(
seconds:
1
));
});
});
...
@@ -203,13 +203,13 @@ void main() {
...
@@ -203,13 +203,13 @@ void main() {
bool
startTracingCalled
=
false
;
bool
startTracingCalled
=
false
;
bool
stopTracingCalled
=
false
;
bool
stopTracingCalled
=
false
;
when
(
mockPeer
.
sendRequest
(
'_setVMTimelineFlags'
,
argThat
(
equals
({
'recordedStreams'
:
'[all]'
}))))
when
(
mockPeer
.
sendRequest
(
'_setVMTimelineFlags'
,
argThat
(
equals
(
<
String
,
dynamic
>
{
'recordedStreams'
:
'[all]'
}))))
.
thenAnswer
((
_
)
async
{
.
thenAnswer
((
_
)
async
{
startTracingCalled
=
true
;
startTracingCalled
=
true
;
return
null
;
return
null
;
});
});
when
(
mockPeer
.
sendRequest
(
'_setVMTimelineFlags'
,
argThat
(
equals
({
'recordedStreams'
:
'[]'
}))))
when
(
mockPeer
.
sendRequest
(
'_setVMTimelineFlags'
,
argThat
(
equals
(
<
String
,
dynamic
>
{
'recordedStreams'
:
'[]'
}))))
.
thenAnswer
((
_
)
async
{
.
thenAnswer
((
_
)
async
{
stopTracingCalled
=
true
;
stopTracingCalled
=
true
;
return
null
;
return
null
;
...
@@ -217,8 +217,8 @@ void main() {
...
@@ -217,8 +217,8 @@ void main() {
when
(
mockPeer
.
sendRequest
(
'_getVMTimeline'
)).
thenAnswer
((
_
)
async
{
when
(
mockPeer
.
sendRequest
(
'_getVMTimeline'
)).
thenAnswer
((
_
)
async
{
return
<
String
,
dynamic
>
{
return
<
String
,
dynamic
>
{
'traceEvents'
:
[
'traceEvents'
:
<
dynamic
>
[
{
<
String
,
String
>
{
'name'
:
'test event'
'name'
:
'test event'
}
}
],
],
...
@@ -242,13 +242,13 @@ void main() {
...
@@ -242,13 +242,13 @@ void main() {
bool
startTracingCalled
=
false
;
bool
startTracingCalled
=
false
;
bool
stopTracingCalled
=
false
;
bool
stopTracingCalled
=
false
;
when
(
mockPeer
.
sendRequest
(
'_setVMTimelineFlags'
,
argThat
(
equals
({
'recordedStreams'
:
'[Dart, GC, Compiler]'
}))))
when
(
mockPeer
.
sendRequest
(
'_setVMTimelineFlags'
,
argThat
(
equals
(
<
String
,
dynamic
>
{
'recordedStreams'
:
'[Dart, GC, Compiler]'
}))))
.
thenAnswer
((
_
)
async
{
.
thenAnswer
((
_
)
async
{
startTracingCalled
=
true
;
startTracingCalled
=
true
;
return
null
;
return
null
;
});
});
when
(
mockPeer
.
sendRequest
(
'_setVMTimelineFlags'
,
argThat
(
equals
({
'recordedStreams'
:
'[]'
}))))
when
(
mockPeer
.
sendRequest
(
'_setVMTimelineFlags'
,
argThat
(
equals
(
<
String
,
dynamic
>
{
'recordedStreams'
:
'[]'
}))))
.
thenAnswer
((
_
)
async
{
.
thenAnswer
((
_
)
async
{
stopTracingCalled
=
true
;
stopTracingCalled
=
true
;
return
null
;
return
null
;
...
@@ -256,8 +256,8 @@ void main() {
...
@@ -256,8 +256,8 @@ void main() {
when
(
mockPeer
.
sendRequest
(
'_getVMTimeline'
)).
thenAnswer
((
_
)
async
{
when
(
mockPeer
.
sendRequest
(
'_getVMTimeline'
)).
thenAnswer
((
_
)
async
{
return
<
String
,
dynamic
>
{
return
<
String
,
dynamic
>
{
'traceEvents'
:
[
'traceEvents'
:
<
dynamic
>
[
{
<
String
,
String
>
{
'name'
:
'test event'
'name'
:
'test event'
}
}
],
],
...
...
packages/flutter_driver/test/src/timeline_summary_test.dart
View file @
c2363c88
...
@@ -28,7 +28,7 @@ void main() {
...
@@ -28,7 +28,7 @@ void main() {
group
(
'frame_count'
,
()
{
group
(
'frame_count'
,
()
{
test
(
'counts frames'
,
()
{
test
(
'counts frames'
,
()
{
expect
(
expect
(
summarize
([
summarize
(
<
Map
<
String
,
dynamic
>>
[
begin
(
1000
),
end
(
2000
),
begin
(
1000
),
end
(
2000
),
begin
(
3000
),
end
(
5000
),
begin
(
3000
),
end
(
5000
),
]).
countFrames
(),
]).
countFrames
(),
...
@@ -39,12 +39,12 @@ void main() {
...
@@ -39,12 +39,12 @@ void main() {
group
(
'average_frame_build_time_millis'
,
()
{
group
(
'average_frame_build_time_millis'
,
()
{
test
(
'returns null when there is no data'
,
()
{
test
(
'returns null when there is no data'
,
()
{
expect
(
summarize
([]).
computeAverageFrameBuildTimeMillis
(),
isNull
);
expect
(
summarize
(
<
Map
<
String
,
dynamic
>>
[]).
computeAverageFrameBuildTimeMillis
(),
isNull
);
});
});
test
(
'computes average frame build time in milliseconds'
,
()
{
test
(
'computes average frame build time in milliseconds'
,
()
{
expect
(
expect
(
summarize
([
summarize
(
<
Map
<
String
,
dynamic
>>
[
begin
(
1000
),
end
(
2000
),
begin
(
1000
),
end
(
2000
),
begin
(
3000
),
end
(
5000
),
begin
(
3000
),
end
(
5000
),
]).
computeAverageFrameBuildTimeMillis
(),
]).
computeAverageFrameBuildTimeMillis
(),
...
@@ -54,7 +54,7 @@ void main() {
...
@@ -54,7 +54,7 @@ void main() {
test
(
'skips leading "end" events'
,
()
{
test
(
'skips leading "end" events'
,
()
{
expect
(
expect
(
summarize
([
summarize
(
<
Map
<
String
,
dynamic
>>
[
end
(
1000
),
end
(
1000
),
begin
(
2000
),
end
(
4000
),
begin
(
2000
),
end
(
4000
),
]).
computeAverageFrameBuildTimeMillis
(),
]).
computeAverageFrameBuildTimeMillis
(),
...
@@ -64,7 +64,7 @@ void main() {
...
@@ -64,7 +64,7 @@ void main() {
test
(
'skips trailing "begin" events'
,
()
{
test
(
'skips trailing "begin" events'
,
()
{
expect
(
expect
(
summarize
([
summarize
(
<
Map
<
String
,
dynamic
>>
[
begin
(
2000
),
end
(
4000
),
begin
(
2000
),
end
(
4000
),
begin
(
5000
),
begin
(
5000
),
]).
computeAverageFrameBuildTimeMillis
(),
]).
computeAverageFrameBuildTimeMillis
(),
...
@@ -75,19 +75,19 @@ void main() {
...
@@ -75,19 +75,19 @@ void main() {
group
(
'worst_frame_build_time_millis'
,
()
{
group
(
'worst_frame_build_time_millis'
,
()
{
test
(
'returns null when there is no data'
,
()
{
test
(
'returns null when there is no data'
,
()
{
expect
(
summarize
([]).
computeWorstFrameBuildTimeMillis
(),
isNull
);
expect
(
summarize
(
<
Map
<
String
,
dynamic
>>
[]).
computeWorstFrameBuildTimeMillis
(),
isNull
);
});
});
test
(
'computes worst frame build time in milliseconds'
,
()
{
test
(
'computes worst frame build time in milliseconds'
,
()
{
expect
(
expect
(
summarize
([
summarize
(
<
Map
<
String
,
dynamic
>>
[
begin
(
1000
),
end
(
2000
),
begin
(
1000
),
end
(
2000
),
begin
(
3000
),
end
(
5000
),
begin
(
3000
),
end
(
5000
),
]).
computeWorstFrameBuildTimeMillis
(),
]).
computeWorstFrameBuildTimeMillis
(),
2.0
2.0
);
);
expect
(
expect
(
summarize
([
summarize
(
<
Map
<
String
,
dynamic
>>
[
begin
(
3000
),
end
(
5000
),
begin
(
3000
),
end
(
5000
),
begin
(
1000
),
end
(
2000
),
begin
(
1000
),
end
(
2000
),
]).
computeWorstFrameBuildTimeMillis
(),
]).
computeWorstFrameBuildTimeMillis
(),
...
@@ -97,7 +97,7 @@ void main() {
...
@@ -97,7 +97,7 @@ void main() {
test
(
'skips leading "end" events'
,
()
{
test
(
'skips leading "end" events'
,
()
{
expect
(
expect
(
summarize
([
summarize
(
<
Map
<
String
,
dynamic
>>
[
end
(
1000
),
end
(
1000
),
begin
(
2000
),
end
(
4000
),
begin
(
2000
),
end
(
4000
),
]).
computeWorstFrameBuildTimeMillis
(),
]).
computeWorstFrameBuildTimeMillis
(),
...
@@ -107,7 +107,7 @@ void main() {
...
@@ -107,7 +107,7 @@ void main() {
test
(
'skips trailing "begin" events'
,
()
{
test
(
'skips trailing "begin" events'
,
()
{
expect
(
expect
(
summarize
([
summarize
(
<
Map
<
String
,
dynamic
>>
[
begin
(
2000
),
end
(
4000
),
begin
(
2000
),
end
(
4000
),
begin
(
5000
),
begin
(
5000
),
]).
computeWorstFrameBuildTimeMillis
(),
]).
computeWorstFrameBuildTimeMillis
(),
...
@@ -118,7 +118,7 @@ void main() {
...
@@ -118,7 +118,7 @@ void main() {
group
(
'computeMissedFrameBuildBudgetCount'
,
()
{
group
(
'computeMissedFrameBuildBudgetCount'
,
()
{
test
(
'computes the number of missed build budgets'
,
()
{
test
(
'computes the number of missed build budgets'
,
()
{
TimelineSummary
summary
=
summarize
([
TimelineSummary
summary
=
summarize
(
<
Map
<
String
,
dynamic
>>
[
begin
(
1000
),
end
(
10000
),
begin
(
1000
),
end
(
10000
),
begin
(
11000
),
end
(
12000
),
begin
(
11000
),
end
(
12000
),
begin
(
13000
),
end
(
23000
),
begin
(
13000
),
end
(
23000
),
...
@@ -132,12 +132,12 @@ void main() {
...
@@ -132,12 +132,12 @@ void main() {
group
(
'summaryJson'
,
()
{
group
(
'summaryJson'
,
()
{
test
(
'computes and returns summary as JSON'
,
()
{
test
(
'computes and returns summary as JSON'
,
()
{
expect
(
expect
(
summarize
([
summarize
(
<
Map
<
String
,
dynamic
>>
[
begin
(
1000
),
end
(
10000
),
begin
(
1000
),
end
(
10000
),
begin
(
11000
),
end
(
12000
),
begin
(
11000
),
end
(
12000
),
begin
(
13000
),
end
(
24000
),
begin
(
13000
),
end
(
24000
),
]).
summaryJson
,
]).
summaryJson
,
{
<
String
,
dynamic
>
{
'average_frame_build_time_millis'
:
7.0
,
'average_frame_build_time_millis'
:
7.0
,
'worst_frame_build_time_millis'
:
11.0
,
'worst_frame_build_time_millis'
:
11.0
,
'missed_frame_build_budget_count'
:
2
,
'missed_frame_build_budget_count'
:
2
,
...
@@ -158,7 +158,7 @@ void main() {
...
@@ -158,7 +158,7 @@ void main() {
});
});
test
(
'writes timeline to JSON file'
,
()
async
{
test
(
'writes timeline to JSON file'
,
()
async
{
await
summarize
(
[
{
'foo'
:
'bar'
}])
await
summarize
(
<
Map
<
String
,
String
>>[<
String
,
String
>
{
'foo'
:
'bar'
}])
.
writeTimelineToFile
(
'test'
,
destinationDirectory:
'/temp'
);
.
writeTimelineToFile
(
'test'
,
destinationDirectory:
'/temp'
);
String
written
=
String
written
=
await
fs
.
file
(
'/temp/test.timeline.json'
).
readAsString
();
await
fs
.
file
(
'/temp/test.timeline.json'
).
readAsString
();
...
@@ -166,14 +166,14 @@ void main() {
...
@@ -166,14 +166,14 @@ void main() {
});
});
test
(
'writes summary to JSON file'
,
()
async
{
test
(
'writes summary to JSON file'
,
()
async
{
await
summarize
([
await
summarize
(
<
Map
<
String
,
dynamic
>>
[
begin
(
1000
),
end
(
10000
),
begin
(
1000
),
end
(
10000
),
begin
(
11000
),
end
(
12000
),
begin
(
11000
),
end
(
12000
),
begin
(
13000
),
end
(
24000
),
begin
(
13000
),
end
(
24000
),
]).
writeSummaryToFile
(
'test'
,
destinationDirectory:
'/temp'
);
]).
writeSummaryToFile
(
'test'
,
destinationDirectory:
'/temp'
);
String
written
=
String
written
=
await
fs
.
file
(
'/temp/test.timeline_summary.json'
).
readAsString
();
await
fs
.
file
(
'/temp/test.timeline_summary.json'
).
readAsString
();
expect
(
JSON
.
decode
(
written
),
{
expect
(
JSON
.
decode
(
written
),
<
String
,
dynamic
>
{
'average_frame_build_time_millis'
:
7.0
,
'average_frame_build_time_millis'
:
7.0
,
'worst_frame_build_time_millis'
:
11.0
,
'worst_frame_build_time_millis'
:
11.0
,
'missed_frame_build_budget_count'
:
2
,
'missed_frame_build_budget_count'
:
2
,
...
...
packages/flutter_driver/test/src/timeline_test.dart
View file @
c2363c88
...
@@ -8,9 +8,9 @@ import 'package:flutter_driver/src/timeline.dart';
...
@@ -8,9 +8,9 @@ import 'package:flutter_driver/src/timeline.dart';
void
main
(
)
{
void
main
(
)
{
group
(
'Timeline'
,
()
{
group
(
'Timeline'
,
()
{
test
(
'parses JSON'
,
()
{
test
(
'parses JSON'
,
()
{
Timeline
timeline
=
new
Timeline
.
fromJson
({
Timeline
timeline
=
new
Timeline
.
fromJson
(
<
String
,
dynamic
>
{
'traceEvents'
:
[
'traceEvents'
:
<
Map
<
String
,
dynamic
>>
[
{
<
String
,
dynamic
>
{
'name'
:
'test event'
,
'name'
:
'test event'
,
'cat'
:
'test category'
,
'cat'
:
'test category'
,
'ph'
:
'B'
,
'ph'
:
'B'
,
...
@@ -19,12 +19,12 @@ void main() {
...
@@ -19,12 +19,12 @@ void main() {
'dur'
:
345
,
'dur'
:
345
,
'ts'
:
456
,
'ts'
:
456
,
'tts'
:
567
,
'tts'
:
567
,
'args'
:
{
'args'
:
<
String
,
dynamic
>
{
'arg1'
:
true
,
'arg1'
:
true
,
}
}
},
},
// Tests that we don't choke on missing data
// Tests that we don't choke on missing data
{}
<
String
,
dynamic
>
{}
]
]
});
});
...
@@ -39,7 +39,7 @@ void main() {
...
@@ -39,7 +39,7 @@ void main() {
expect
(
e1
.
duration
,
const
Duration
(
microseconds:
345
));
expect
(
e1
.
duration
,
const
Duration
(
microseconds:
345
));
expect
(
e1
.
timestampMicros
,
456
);
expect
(
e1
.
timestampMicros
,
456
);
expect
(
e1
.
threadTimestampMicros
,
567
);
expect
(
e1
.
threadTimestampMicros
,
567
);
expect
(
e1
.
arguments
,
{
'arg1'
:
true
});
expect
(
e1
.
arguments
,
<
String
,
dynamic
>
{
'arg1'
:
true
});
TimelineEvent
e2
=
timeline
.
events
[
1
];
TimelineEvent
e2
=
timeline
.
events
[
1
];
expect
(
e2
.
name
,
isNull
);
expect
(
e2
.
name
,
isNull
);
...
...
packages/flutter_sprites/lib/src/nine_slice_sprite.dart
View file @
c2363c88
...
@@ -92,7 +92,7 @@ class NineSliceSprite extends NodeWithSize with SpritePaint {
...
@@ -92,7 +92,7 @@ class NineSliceSprite extends NodeWithSize with SpritePaint {
if
(
_isDirty
)
{
if
(
_isDirty
)
{
// Calcuate vertices and indices.
// Calcuate vertices and indices.
_vertices
=
[
_vertices
=
<
Point
>
[
Point
.
origin
,
Point
.
origin
,
];
];
...
...
packages/flutter_sprites/test/action_test.dart
View file @
c2363c88
...
@@ -158,7 +158,7 @@ void main() {
...
@@ -158,7 +158,7 @@ void main() {
ActionTween
tween0
=
new
ActionTween
((
double
a
)
=>
value0
=
a
,
0.0
,
1.0
,
10.0
);
ActionTween
tween0
=
new
ActionTween
((
double
a
)
=>
value0
=
a
,
0.0
,
1.0
,
10.0
);
ActionTween
tween1
=
new
ActionTween
((
double
a
)
=>
value1
=
a
,
0.0
,
1.0
,
20.0
);
ActionTween
tween1
=
new
ActionTween
((
double
a
)
=>
value1
=
a
,
0.0
,
1.0
,
20.0
);
ActionGroup
group
=
new
ActionGroup
([
tween0
,
tween1
]);
ActionGroup
group
=
new
ActionGroup
(
<
ActionTween
>
[
tween0
,
tween1
]);
expect
(
group
.
duration
,
closeTo
(
20.0
,
epsilon
));
expect
(
group
.
duration
,
closeTo
(
20.0
,
epsilon
));
group
.
update
(
0.0
);
group
.
update
(
0.0
);
...
@@ -180,7 +180,7 @@ void main() {
...
@@ -180,7 +180,7 @@ void main() {
ActionTween
tween0
=
new
ActionTween
((
double
a
)
=>
doubleValue
=
a
,
0.0
,
1.0
,
4.0
);
ActionTween
tween0
=
new
ActionTween
((
double
a
)
=>
doubleValue
=
a
,
0.0
,
1.0
,
4.0
);
ActionTween
tween1
=
new
ActionTween
((
double
a
)
=>
doubleValue
=
a
,
1.0
,
0.0
,
12.0
);
ActionTween
tween1
=
new
ActionTween
((
double
a
)
=>
doubleValue
=
a
,
1.0
,
0.0
,
12.0
);
ActionSequence
sequence
=
new
ActionSequence
([
tween0
,
tween1
]);
ActionSequence
sequence
=
new
ActionSequence
(
<
ActionTween
>
[
tween0
,
tween1
]);
expect
(
sequence
.
duration
,
closeTo
(
16.0
,
epsilon
));
expect
(
sequence
.
duration
,
closeTo
(
16.0
,
epsilon
));
sequence
.
update
(
0.0
);
sequence
.
update
(
0.0
);
...
...
packages/flutter_sprites/test/constraint_test.dart
View file @
c2363c88
...
@@ -19,7 +19,7 @@ void main() {
...
@@ -19,7 +19,7 @@ void main() {
parent
.
addChild
(
node0
);
parent
.
addChild
(
node0
);
parent
.
addChild
(
node1
);
parent
.
addChild
(
node1
);
node1
.
constraints
=
[(
new
ConstraintPositionToNode
(
node0
))];
node1
.
constraints
=
<
Constraint
>
[(
new
ConstraintPositionToNode
(
node0
))];
node0
.
position
=
const
Point
(
100.0
,
50.0
);
node0
.
position
=
const
Point
(
100.0
,
50.0
);
node1
.
applyConstraints
(
0.1
);
node1
.
applyConstraints
(
0.1
);
...
@@ -37,7 +37,7 @@ void main() {
...
@@ -37,7 +37,7 @@ void main() {
parent
.
addChild
(
node0
);
parent
.
addChild
(
node0
);
parent
.
addChild
(
node1
);
parent
.
addChild
(
node1
);
node1
.
constraints
=
[(
new
ConstraintRotationToNode
(
node0
))];
node1
.
constraints
=
<
Constraint
>
[(
new
ConstraintRotationToNode
(
node0
))];
node1
.
applyConstraints
(
0.1
);
node1
.
applyConstraints
(
0.1
);
...
@@ -53,7 +53,7 @@ void main() {
...
@@ -53,7 +53,7 @@ void main() {
parent
.
addChild
(
node0
);
parent
.
addChild
(
node0
);
parent
.
addChild
(
node1
);
parent
.
addChild
(
node1
);
node1
.
constraints
=
[(
new
ConstraintRotationToNodeRotation
(
node0
,
baseRotation:
10.0
))];
node1
.
constraints
=
<
Constraint
>
[(
new
ConstraintRotationToNodeRotation
(
node0
,
baseRotation:
10.0
))];
node0
.
rotation
=
90.0
;
node0
.
rotation
=
90.0
;
node1
.
applyConstraints
(
0.1
);
node1
.
applyConstraints
(
0.1
);
...
@@ -69,7 +69,7 @@ void main() {
...
@@ -69,7 +69,7 @@ void main() {
parent
.
addChild
(
node0
);
parent
.
addChild
(
node0
);
Constraint
constraint
=
new
ConstraintRotationToMovement
();
Constraint
constraint
=
new
ConstraintRotationToMovement
();
node0
.
constraints
=
[
constraint
];
node0
.
constraints
=
<
Constraint
>
[
constraint
];
node0
.
position
=
const
Point
(
0.0
,
0.0
);
node0
.
position
=
const
Point
(
0.0
,
0.0
);
constraint
.
preUpdate
(
node0
,
0.1
);
constraint
.
preUpdate
(
node0
,
0.1
);
...
...
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