Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 400d81c

Browse files
committed
modify according to dnfield@
1 parent ca3d26b commit 400d81c

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

packages/integration_test/example/test_driver/example_integration_io.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ void main() {
2020
// Build our app and trigger a frame.
2121
app.main();
2222

23+
// Trace the timeline of the following operation. The timeline result will
24+
// be written to `build/integration_response_data.json` with the key
25+
// `timeline`.
2326
await binding.traceAction(() async {
2427
// Trigger a frame.
2528
await tester.pumpAndSettle();

packages/integration_test/lib/integration_test.dart

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ class IntegrationTestWidgetsFlutterBinding
219219
await _vmService.setVMTimelineFlags(streams);
220220
}
221221

222-
/// Runs [action] and outputs a [vm.Timeline] trace for it.
222+
/// Runs [action] and returns a [vm.Timeline] trace for it.
223223
///
224224
/// Waits for the `Future` returned by [action] to complete prior to stopping
225225
/// the trace.
226226
///
227-
/// `streams` limits the recorded timeline event streams to only the ones
228-
/// listed. By default, all streams are recorded.
227+
/// The `streams` parameter limits the recorded timeline event streams to only
228+
/// the ones listed. By default, all streams are recorded.
229229
/// See `timeline_streams` in
230230
/// https://github.com/dart-lang/sdk/blob/master/runtime/vm/timeline.cc
231231
///
@@ -253,8 +253,16 @@ class IntegrationTestWidgetsFlutterBinding
253253
);
254254
}
255255

256-
/// This is a convience wrap of [traceTimeline] and send the result back to
257-
/// the host.
256+
/// This is a convenience wrap of [traceTimeline] and send the result back to
257+
/// the host for the [flutter_driver] style tests.
258+
///
259+
/// This records the timeline during `action` and adds the result to
260+
/// [reportData] with `reportKey`.
261+
///
262+
/// For tests with multiple calls of this method, `reportKey` needs to be a
263+
/// unique key, otherwise the later result will override earlier one.
264+
///
265+
/// `streams` and `retainPriorEvents` are passed as-is to [traceTimeline].
258266
Future<void> traceAction(
259267
Future<dynamic> action(), {
260268
List<String> streams = const <String>['all'],

0 commit comments

Comments
 (0)