@@ -391,48 +391,54 @@ void main() {
391391 expect (resolution.keys, isNot (contains ('text' )));
392392 });
393393
394- testWidgets ('production semantic map requires explicit test opt-in' , (
395- tester,
396- ) async {
397- await tester.pumpWidget (
398- MaterialApp (
399- builder: (context, child) => TugboatReplay .wrapApp (
400- config: const TugboatReplayConfig (
401- profile: TugboatCaptureProfile .productionLean,
402- settleDelay: Duration .zero,
403- enableGlobalPointerCapture: false ,
404- capturePixelRatio: 1.0 ,
405- viewportSemanticMode: TugboatViewportSemanticMode .full,
406- viewportSemanticMapMaxNodes: 1 ,
394+ testWidgets (
395+ 'production semantic map emission stays off even with full mode' ,
396+ (tester) async {
397+ await tester.pumpWidget (
398+ MaterialApp (
399+ builder: (context, child) => TugboatReplay .wrapApp (
400+ config: const TugboatReplayConfig (
401+ profile: TugboatCaptureProfile .productionLean,
402+ settleDelay: Duration .zero,
403+ enableGlobalPointerCapture: false ,
404+ capturePixelRatio: 1.0 ,
405+ viewportSemanticMode: TugboatViewportSemanticMode .full,
406+ viewportSemanticMapMaxNodes: 1 ,
407+ ),
408+ child: child! ,
407409 ),
408- child: child! ,
409- ),
410- home: Scaffold (
411- body: Column (
412- children: [
413- FilledButton (onPressed: () {}, child: const Text ('Go' )),
414- FilledButton (onPressed: () {}, child: const Text ('Next' )),
415- ],
410+ home: Scaffold (
411+ body: Column (
412+ children: [
413+ FilledButton (onPressed: () {}, child: const Text ('Go' )),
414+ FilledButton (onPressed: () {}, child: const Text ('Next' )),
415+ ],
416+ ),
416417 ),
417418 ),
418- ),
419- );
420- await tester.pump ();
421- await _waitForCaptures (tester);
419+ );
420+ await tester.pump ();
421+ await _waitForCaptures (tester);
422422
423- final controller = TugboatReplay .controller! ;
424- controller.recordPointerDown (tester.getCenter (find.text ('Go' )));
425- await tester.pump ();
423+ final controller = TugboatReplay .controller! ;
424+ controller.recordPointerDown (tester.getCenter (find.text ('Go' )));
425+ await tester.pump ();
426426
427- final mapEvent = controller.session! .events
428- .where ((event) => event.type == 'viewport_semantic_map' )
429- .single;
430- final nodes = mapEvent.data['nodes' ] as List ;
431- final summary = mapEvent.data['summary' ] as Map <Object ?, Object ?>;
432- expect (nodes.length, lessThanOrEqualTo (1 ));
433- expect (summary['truncatedCount' ], isA <int >());
434- expect (summary['totalNodes' ], nodes.length);
435- });
427+ final mapEvents = controller.session! .events
428+ .where (
429+ (event) =>
430+ event.type == 'viewport_semantic_map' ||
431+ event.type == 'scroll_semantic_snapshot' ,
432+ )
433+ .toList ();
434+ expect (mapEvents, isEmpty);
435+
436+ final tapEvent = controller.session! .events
437+ .where ((event) => event.type == 'tap' )
438+ .last;
439+ expect (tapEvent.data['viewportSemanticResolution' ], isNotNull);
440+ },
441+ );
436442
437443 testWidgets ('production semantic map stays off with default mode' , (
438444 tester,
@@ -576,7 +582,10 @@ void main() {
576582 .whereType <String >()
577583 .where ((fingerprint) => fingerprint.isNotEmpty)
578584 .toSet ();
579- expect (linkedFingerprints.intersection (inventoryFingerprints), isNotEmpty);
585+ expect (
586+ linkedFingerprints.intersection (inventoryFingerprints),
587+ isNotEmpty,
588+ );
580589
581590 final inventoryIndex = events.indexWhere (
582591 (event) => event.type == 'scene_inventory' ,
0 commit comments