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
770f8f1d
Commit
770f8f1d
authored
May 10, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename TracingCategory to TimelineStream (#3822)
parent
36d437d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
31 deletions
+31
-31
transitions_perf_test.dart
...es/flutter_gallery/test_driver/transitions_perf_test.dart
+4
-4
flutter_driver.dart
packages/flutter_driver/lib/flutter_driver.dart
+1
-1
driver.dart
packages/flutter_driver/lib/src/driver.dart
+20
-20
flutter_driver_test.dart
packages/flutter_driver/test/flutter_driver_test.dart
+6
-6
No files found.
examples/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
770f8f1d
...
...
@@ -80,10 +80,10 @@ void main() {
}
}
},
categories:
const
<
TracingCategory
>[
T
racingCategory
.
dart
,
T
racingCategory
.
gc
,
T
racingCategory
.
compiler
streams:
const
<
TimelineStream
>[
T
imelineStream
.
dart
,
T
imelineStream
.
gc
,
T
imelineStream
.
compiler
]);
new
TimelineSummary
.
summarize
(
timeline
)
..
writeSummaryToFile
(
'transitions_perf'
,
pretty:
true
)
...
...
packages/flutter_driver/lib/flutter_driver.dart
View file @
770f8f1d
...
...
@@ -16,7 +16,7 @@ export 'src/driver.dart' show
CommonFinders
,
EvaluatorFunction
,
FlutterDriver
,
T
racingCategory
;
T
imelineStream
;
export
'src/error.dart'
show
DriverError
,
...
...
packages/flutter_driver/lib/src/driver.dart
View file @
770f8f1d
...
...
@@ -15,27 +15,27 @@ import 'health.dart';
import
'message.dart'
;
import
'timeline.dart'
;
enum
T
racingCategory
{
enum
T
imelineStream
{
all
,
api
,
compiler
,
dart
,
debugger
,
embedder
,
gc
,
isolate
,
vm
}
const
List
<
T
racingCategory
>
_defaultCategories
=
const
<
TracingCategory
>[
TracingCategory
.
all
];
const
List
<
T
imelineStream
>
_defaultStreams
=
const
<
TimelineStream
>[
TimelineStream
.
all
];
// See https://github.com/dart-lang/sdk/blob/master/runtime/vm/timeline.cc#L32
String
_t
racingCategoriesToString
(
List
<
TracingCategory
>
categorie
s
)
{
final
String
contents
=
categories
.
map
((
TracingCategory
category
)
{
switch
(
category
)
{
case
T
racingCategory
.
all
:
return
'all'
;
case
T
racingCategory
.
api
:
return
'API'
;
case
T
racingCategory
.
compiler
:
return
'Compiler'
;
case
T
racingCategory
.
dart
:
return
'Dart'
;
case
T
racingCategory
.
debugger
:
return
'Debugger'
;
case
T
racingCategory
.
embedder
:
return
'Embedder'
;
case
T
racingCategory
.
gc
:
return
'GC'
;
case
T
racingCategory
.
isolate
:
return
'Isolate'
;
case
T
racingCategory
.
vm
:
return
'VM'
;
String
_t
imelineStreamsToString
(
List
<
TimelineStream
>
stream
s
)
{
final
String
contents
=
streams
.
map
((
TimelineStream
stream
)
{
switch
(
stream
)
{
case
T
imelineStream
.
all
:
return
'all'
;
case
T
imelineStream
.
api
:
return
'API'
;
case
T
imelineStream
.
compiler
:
return
'Compiler'
;
case
T
imelineStream
.
dart
:
return
'Dart'
;
case
T
imelineStream
.
debugger
:
return
'Debugger'
;
case
T
imelineStream
.
embedder
:
return
'Embedder'
;
case
T
imelineStream
.
gc
:
return
'GC'
;
case
T
imelineStream
.
isolate
:
return
'Isolate'
;
case
T
imelineStream
.
vm
:
return
'VM'
;
default
:
throw
'Unknown t
racing category
$category
'
;
throw
'Unknown t
imeline stream
$stream
'
;
}
}).
join
(
', '
);
return
'[
$contents
]'
;
...
...
@@ -249,11 +249,11 @@ class FlutterDriver {
}
/// Starts recording performance traces.
Future
<
Null
>
startTracing
({
List
<
T
racingCategory
>
categories:
_defaultCategorie
s
})
async
{
assert
(
categories
!=
null
&&
categorie
s
.
length
>
0
);
Future
<
Null
>
startTracing
({
List
<
T
imelineStream
>
streams:
_defaultStream
s
})
async
{
assert
(
streams
!=
null
&&
stream
s
.
length
>
0
);
try
{
await
_peer
.
sendRequest
(
_kSetVMTimelineFlagsMethod
,
<
String
,
String
>{
'recordedStreams'
:
_t
racingCategoriesToString
(
categorie
s
)
'recordedStreams'
:
_t
imelineStreamsToString
(
stream
s
)
});
return
null
;
}
catch
(
error
,
stackTrace
)
{
...
...
@@ -286,8 +286,8 @@ class FlutterDriver {
///
/// This is merely a convenience wrapper on top of [startTracing] and
/// [stopTracingAndDownloadTimeline].
Future
<
Timeline
>
traceAction
(
Future
<
dynamic
>
action
(),
{
List
<
T
racingCategory
>
categories:
_defaultCategorie
s
})
async
{
await
startTracing
(
categories:
categorie
s
);
Future
<
Timeline
>
traceAction
(
Future
<
dynamic
>
action
(),
{
List
<
T
imelineStream
>
streams:
_defaultStream
s
})
async
{
await
startTracing
(
streams:
stream
s
);
await
action
();
return
stopTracingAndDownloadTimeline
();
}
...
...
packages/flutter_driver/test/flutter_driver_test.dart
View file @
770f8f1d
...
...
@@ -236,8 +236,8 @@ void main() {
});
});
group
(
'traceAction
categorie
s'
,
()
{
test
(
'specify non-default
categorie
s'
,
()
async
{
group
(
'traceAction
with timeline stream
s'
,
()
{
test
(
'specify non-default
timeline stream
s'
,
()
async
{
bool
actionCalled
=
false
;
bool
startTracingCalled
=
false
;
bool
stopTracingCalled
=
false
;
...
...
@@ -267,10 +267,10 @@ void main() {
Timeline
timeline
=
await
driver
.
traceAction
(()
{
actionCalled
=
true
;
},
categories:
const
<
TracingCategory
>[
T
racingCategory
.
dart
,
T
racingCategory
.
gc
,
T
racingCategory
.
compiler
streams:
const
<
TimelineStream
>[
T
imelineStream
.
dart
,
T
imelineStream
.
gc
,
T
imelineStream
.
compiler
]);
expect
(
actionCalled
,
isTrue
);
...
...
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