@@ -1464,6 +1464,44 @@ void main() {
14641464 expect (TugboatReplay .lifecycleState, TugboatLifecycleState .active);
14651465 });
14661466
1467+ testWidgets ('runtime capture applies a combined enable and grant rebuild' , (
1468+ tester,
1469+ ) async {
1470+ addTearDown (TugboatReplay .resetForTest);
1471+ final upgraded = ValueNotifier <bool >(false );
1472+ addTearDown (upgraded.dispose);
1473+
1474+ await tester.pumpWidget (
1475+ ValueListenableBuilder <bool >(
1476+ valueListenable: upgraded,
1477+ builder: (context, value, _) => MaterialApp (
1478+ builder: (context, child) => TugboatReplay .wrapApp (
1479+ config: _testConfig.copyWith (
1480+ enabled: value,
1481+ emitSceneInventory: value,
1482+ ),
1483+ child: child! ,
1484+ ),
1485+ home: const Scaffold (body: Text ('Combined grant' )),
1486+ ),
1487+ ),
1488+ );
1489+ await tester.pump ();
1490+ expect (TugboatReplay .controller, isNull);
1491+
1492+ TugboatReplay .activate (activationRequestId: 'combined-grant' );
1493+ await _waitForCaptures (tester);
1494+ final runtimeController = TugboatReplay .controller! ;
1495+ expect (runtimeController.config.emitSceneInventory, isFalse);
1496+
1497+ upgraded.value = true ;
1498+ await _waitForCaptures (tester);
1499+ final upgradedController = TugboatReplay .controller! ;
1500+ expect (upgradedController, isNot (same (runtimeController)));
1501+ expect (upgradedController.config.emitSceneInventory, isTrue);
1502+ expect (TugboatReplay .lifecycleState, TugboatLifecycleState .active);
1503+ });
1504+
14671505 testWidgets ('disabled config stays inert until activated without rebuild' , (
14681506 tester,
14691507 ) async {
0 commit comments