iPad layout review notes and native fixture host
Run the full-app fixture entry on an iOS simulator: options from a file in the app's tmp dir or the environment, route via a route provider, a narrow strip for Split View widths, and a small in-app tap/type driver.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
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<String, String> fixtureParams() => Uri.base.queryParameters;
|
||||
|
||||
/// Installs the DevTools-facing probes the capture kit evaluates.
|
||||
void installHostProbes(Map<String, String> 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<String, String> 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<String, String> params) => runApp(app);
|
||||
Reference in New Issue
Block a user