import 'package:flutter/widgets.dart'; import 'package:pipelines_app/application/server_endpoint.dart'; import 'package:web/web.dart' as web; import '../perf/backdrop_census.dart'; import '../perf/chat_scroll_probe.dart'; import '../perf/frame_log.dart'; /// The fixture options: the page URL's query. Map fixtureParams() => Uri.base.queryParameters; /// Installs the DevTools-facing probes the capture kit evaluates. void installHostProbes(Map params) { installBackdropCensus(); installFrameLog(params); installChatScrollProbe(); } /// Moves the browser to [route] before the app reads its location. void openFixtureRoute(String route, {required bool cupertino}) { final platform = cupertino ? 'platform=cupertino' : ''; final joiner = route.contains('?') ? '&' : '?'; web.window.history.replaceState( null, '', platform.isEmpty ? route : '$route$joiner$platform', ); } /// The browser build's endpoint is its own page origin. ServerEndpoint fixtureServer(Map params) => ServerEndpoint.resolve(base: Uri.base, web: true); /// The browser's location is the route; no provider is needed. RouteInformationProvider? fixtureRouteProvider(String? route) => null; /// Runs [app] unchanged. void runFixtureApp(Widget app, Map params) => runApp(app);