docimports for flutter_driver (#151267)

Part of https://github.com/flutter/flutter/issues/150800
This commit is contained in:
Michael Goderbauer 2024-07-11 11:30:26 -07:00 committed by GitHub
parent defdb958ff
commit b13f50a918
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 63 additions and 26 deletions

View File

@ -22,6 +22,8 @@
/// enableFlutterDriverExtension();
/// runApp(ExampleApp());
/// }
///
/// @docImport 'src/extension/extension.dart';
library flutter_driver_extension;
export 'src/common/deserialization_factory.dart';

View File

@ -18,7 +18,7 @@ import 'text.dart';
import 'text_input_action.dart';
import 'wait.dart';
/// A factory for deserializing [Finder]s.
/// A factory for deserializing [SerializableFinder]s.
mixin DeserializeFinderFactory {
/// Deserializes the finder from JSON generated by [SerializableFinder.serialize].
SerializableFinder deserializeFinder(Map<String, String> json) {

View File

@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'package:flutter/foundation.dart';
library;
import 'enum_util.dart';
import 'find.dart';
import 'message.dart';

View File

@ -2,6 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'package:flutter/semantics.dart';
/// @docImport 'package:flutter/widgets.dart';
/// @docImport 'package:flutter_driver/flutter_driver.dart';
/// @docImport 'package:flutter_test/flutter_test.dart';
library;
import 'dart:convert';
import 'package:meta/meta.dart';
@ -174,12 +180,12 @@ class BySemanticsLabel extends SerializableFinder {
}
/// A Flutter Driver finder that finds widgets by [text] inside a
/// [widgets.Text] or [widgets.EditableText] widget.
/// [Text] or [EditableText] widget.
class ByText extends SerializableFinder {
/// Creates a text finder given the text.
const ByText(this.text);
/// The text that appears inside the [widgets.Text] or [widgets.EditableText]
/// The text that appears inside the [Text] or [EditableText]
/// widget.
final String text;

View File

@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'package:flutter/widgets.dart';
library;
import 'find.dart';
/// A Flutter Driver command that taps on a target widget located by [finder].

View File

@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'package:flutter_driver/flutter_driver.dart';
library;
import 'dart:async';
import 'package:flutter/cupertino.dart';

View File

@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'package:flutter_driver/flutter_driver.dart';
library;
import 'enum_util.dart';
import 'message.dart';

View File

@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'package:flutter_driver/flutter_driver.dart';
library;
import 'message.dart';
/// A Flutter Driver command that requests a string representation of the layer tree.

View File

@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'package:flutter/widgets.dart';
library;
import 'package:meta/meta.dart';
/// An object sent from the Flutter Driver to a Flutter application to instruct

View File

@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'package:flutter_driver/flutter_driver.dart';
library;
import 'message.dart';
/// A Flutter Driver command that requests a string representation of the render tree.

View File

@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'package:flutter/widgets.dart';
library;
import 'dart:convert';
import 'message.dart';

View File

@ -2,6 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'package:flutter/services.dart';
/// @docImport 'package:flutter/widgets.dart';
/// @docImport 'package:flutter_driver/driver_extension.dart';
/// @docImport 'package:flutter_test/flutter_test.dart';
library;
import 'dart:io';
import 'package:meta/meta.dart';
@ -762,7 +769,7 @@ abstract class FlutterDriver {
class CommonFinders {
const CommonFinders._();
/// Finds [widgets.Text] and [widgets.EditableText] widgets containing string
/// Finds [Text] and [EditableText] widgets containing string
/// equal to [text].
SerializableFinder text(String text) => ByText(text);

View File

@ -8,7 +8,7 @@ import 'timeline.dart';
/// Event name for frame request pending timeline events.
const String kFrameRequestPendingEvent = 'Frame Request Pending';
/// Summarizes [TimelineEvents]s corresponding to [kFrameRequestPendingEvent] events.
/// Summarizes [TimelineEvent]s corresponding to [kFrameRequestPendingEvent] events.
///
/// `FrameRequestPendingLatency` is the time between `Animator::RequestFrame`
/// and `Animator::BeginFrame` for each frame built by the Flutter engine.
@ -16,7 +16,7 @@ class FrameRequestPendingLatencySummarizer {
/// Creates a FrameRequestPendingLatencySummarizer given the timeline events.
FrameRequestPendingLatencySummarizer(this.frameRequestPendingEvents);
/// Timeline events with names in [kFrameRequestPendingTimelineEventNames].
/// Timeline events with names in [kFrameRequestPendingEvent].
final List<TimelineEvent> frameRequestPendingEvents;
/// Computes the average `FrameRequestPendingLatency` over the period of the timeline.

View File

@ -14,7 +14,7 @@ const Set<String> kGCRootEvents = <String>{
'StartConcurrentMark',
};
/// Summarizes [TimelineEvents]s corresponding to [kGCRootEvents] category.
/// Summarizes [TimelineEvent]s corresponding to [kGCRootEvents] category.
///
/// A sample event (some fields have been omitted for brevity):
/// ```json

View File

@ -33,7 +33,7 @@ enum ProfileType {
Memory,
}
/// Summarizes [TimelineEvents]s corresponding to [kProfilingEvents] category.
/// Summarizes [TimelineEvent]s corresponding to [kProfilingEvents] category.
///
/// A sample event (some fields have been omitted for brevity):
/// ```json

View File

@ -13,7 +13,7 @@ const String _kLayerMemory = 'LayerMBytes';
const String _kPictureCount = 'PictureCount';
const String _kPictureMemory = 'PictureMBytes';
/// Summarizes [TimelineEvents]s corresponding to [kRasterCacheEvent] events.
/// Summarizes [TimelineEvent]s corresponding to [kRasterCacheEvent] events.
///
/// A sample event (some fields have been omitted for brevity):
/// ```json

View File

@ -7,7 +7,7 @@ import 'timeline.dart';
/// Event name for refresh rate related timeline events.
const String kUIThreadVsyncProcessEvent = 'VsyncProcessCallback';
/// A summary of [TimelineEvents]s corresponding to `kUIThreadVsyncProcessEvent` events.
/// A summary of [TimelineEvent]s corresponding to `kUIThreadVsyncProcessEvent` events.
///
/// `RefreshRate` is the time between the start of a vsync pulse and the target time of that vsync.
class RefreshRateSummary {

View File

@ -10,7 +10,7 @@ const String kSceneDisplayLagEvent = 'SceneDisplayLag';
const String _kVsyncTransitionsMissed = 'vsync_transitions_missed';
/// Summarizes [TimelineEvents]s corresponding to [kSceneDisplayLagEvent] events.
/// Summarizes [TimelineEvent]s corresponding to [kSceneDisplayLagEvent] events.
///
/// A sample event (some fields have been omitted for brevity):
/// ```json

View File

@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'dart:developer';
library;
import 'dart:async';
import 'dart:convert';
import 'dart:io';
@ -281,7 +284,7 @@ class VMServiceFlutterDriver extends FlutterDriver {
/// Client connected to the Dart VM running the Flutter application.
///
/// You can use [VMServiceClient] to check VM version, flags and get
/// You can use [vms.VmService] to check VM version, flags and get
/// notified when a new isolate has been instantiated. That could be
/// useful if your application spawns multiple isolates that you
/// would like to instrument.
@ -297,7 +300,7 @@ class VMServiceFlutterDriver extends FlutterDriver {
///
/// If you used the [registerExtension] API to instrument your application,
/// you can use this [vms.Isolate] to call these extension methods via
/// [invokeExtension].
/// [vms.Isolate.invokeExtension].
final vms.Isolate _appIsolate;
/// Whether to print communication between host and app to `stdout`.
@ -554,7 +557,7 @@ String _getWebSocketUrl(String url) {
}
/// Waits for a real Dart VM service to become available, then connects using
/// the [VMServiceClient].
/// the [vms.VmService].
Future<vms.VmService> _waitAndConnect(String url, Map<String, dynamic>? headers) async {
final String webSocketUrl = _getWebSocketUrl(url);
int attempts = 0;

View File

@ -14,7 +14,7 @@ const Set<String> kVsyncTimelineEventNames = <String>{
_kPlatformVsyncEvent,
};
/// Summarizes [TimelineEvents]s corresponding to [kVsyncTimelineEventNames] events.
/// Summarizes [TimelineEvent]s corresponding to [kVsyncTimelineEventNames] events.
///
/// `VsyncFrameLag` is the time between when a platform vsync event is received to
/// when the frame starts getting processed by the Flutter Engine. This delay is

View File

@ -3,10 +3,6 @@
// found in the LICENSE file.
/// The dart:io implementation of [registerWebServiceExtension].
///
/// See also:
///
/// * [_extension_web.dart], which has the web implementation
void registerWebServiceExtension(Future<Map<String, dynamic>> Function(Map<String, String>) call) {
throw UnsupportedError('Use registerServiceExtension instead');
}

View File

@ -15,10 +15,6 @@ external JSObject get _window;
///
/// window.$flutterDriver will be called by Flutter Web Driver to process
/// Flutter Command.
///
/// See also:
///
/// * [_extension_io.dart], which has the dart:io implementation
void registerWebServiceExtension(Future<Map<String, dynamic>> Function(Map<String, String>) call) {
// Define the result variable because packages/flutter_driver/lib/src/driver/web_driver.dart
// checks for this value to become non-null when waiting for the result. If this value is

View File

@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'package:flutter_driver/flutter_driver.dart';
library;
import 'dart:async';
import 'package:flutter/cupertino.dart';

View File

@ -37,7 +37,7 @@ class _InternalNoTransientCallbacksCondition implements WaitCondition {
/// Creates an [_InternalNoTransientCallbacksCondition] instance.
const _InternalNoTransientCallbacksCondition();
/// Factory constructor to parse an [InternalNoTransientCallbacksCondition]
/// Factory constructor to parse an [_InternalNoTransientCallbacksCondition]
/// instance from the given [SerializableWaitCondition] instance.
factory _InternalNoTransientCallbacksCondition.deserialize(SerializableWaitCondition condition) {
if (condition.conditionName != 'NoTransientCallbacksCondition') {
@ -63,7 +63,7 @@ class _InternalNoPendingFrameCondition implements WaitCondition {
/// Creates an [_InternalNoPendingFrameCondition] instance.
const _InternalNoPendingFrameCondition();
/// Factory constructor to parse an [InternalNoPendingFrameCondition] instance
/// Factory constructor to parse an [_InternalNoPendingFrameCondition] instance
/// from the given [SerializableWaitCondition] instance.
factory _InternalNoPendingFrameCondition.deserialize(SerializableWaitCondition condition) {
if (condition.conditionName != 'NoPendingFrameCondition') {
@ -89,7 +89,7 @@ class _InternalFirstFrameRasterizedCondition implements WaitCondition {
/// Creates an [_InternalFirstFrameRasterizedCondition] instance.
const _InternalFirstFrameRasterizedCondition();
/// Factory constructor to parse an [InternalNoPendingFrameCondition] instance
/// Factory constructor to parse an [_InternalFirstFrameRasterizedCondition] instance
/// from the given [SerializableWaitCondition] instance.
factory _InternalFirstFrameRasterizedCondition.deserialize(SerializableWaitCondition condition) {
if (condition.conditionName != 'FirstFrameRasterizedCondition') {