Add generic capture kit and repo-owned test memory watchdog

app/tool/capture: one Chrome DevTools capture CLI over the full-app fixture
(serve build or URL, private headless Chrome or --cdp attach, label/key/xy
clicks via Flutter semantics, type, press, scroll, screenshots, filmed
clicks with a canvas contact sheet, cleanup on exit/signal), README recipes
and an example script. The fixture entry gains ?theme=light|dark.

app/tool/memwatch: run.sh/full.sh watchdog moved from /tmp (output dir
created if missing, exit status propagated) plus install.sh for the legacy
/tmp/memwatch shims. app/AGENTS.md points tests at full.sh and UI review at
the capture kit.
This commit is contained in:
2026-11-01 21:22:08 +00:00
parent b57b494959
commit ea428d3c98
12 changed files with 754 additions and 6 deletions
+41 -5
View File
@@ -477,7 +477,13 @@ class _FixtureSink implements WebSocketSink {
/// fallback for `/runs/7`) can still open a deep location:
///
/// `?route=/runs/7/stage/build%3Fvisit%3D1` opens that app location;
/// `?q=release` types that query into Search once its field is shown.
/// `?q=release` types that query into Search once its field is shown;
/// `?platform=cupertino` renders the Cupertino host (`material`, the
/// default, renders Material as browsers do);
/// `?theme=dark` / `?theme=light` pins the platform brightness the app's
/// `ThemeMode.system` follows (omitted: the browser's color scheme).
///
/// app/tool/capture/ drives this entry generically; see its README.
void main() {
final params = Uri.base.queryParameters;
final cupertino = params['platform'] == 'cupertino';
@@ -494,11 +500,41 @@ void main() {
final query = params['q'];
if (query != null && query.isNotEmpty) _typeSearchWhenShown(query);
useAppUrlStrategy();
final app = PipelinesApp(
server: ServerEndpoint.resolve(base: Uri.base, web: true),
client: PipelinesClient(channelFactory: (_) => _FixtureChannel()),
cupertino: cupertino,
);
final brightness = switch (params['theme']) {
'dark' => Brightness.dark,
'light' => Brightness.light,
_ => null,
};
runApp(
PipelinesApp(
server: ServerEndpoint.resolve(base: Uri.base, web: true),
client: PipelinesClient(channelFactory: (_) => _FixtureChannel()),
cupertino: cupertino,
brightness == null
? app
: _PinnedBrightness(brightness: brightness, child: app),
);
}
/// Pins the platform brightness below it. The app's own `MediaQuery.fromView`
/// takes platform fields from this ambient query, so `ThemeMode.system` (and
/// the Cupertino theme's null brightness) resolve to [brightness] while size,
/// padding and text scale still follow the real view.
class _PinnedBrightness extends StatelessWidget {
const _PinnedBrightness({required this.brightness, required this.child});
final Brightness brightness;
final Widget child;
@override
Widget build(BuildContext context) => MediaQuery.fromView(
view: View.of(context),
child: Builder(
builder: (context) => MediaQuery(
data: MediaQuery.of(context).copyWith(platformBrightness: brightness),
child: child,
),
),
);
}