From fbfbf3d64f028da95368f8cd5c80ca0f77e482d0 Mon Sep 17 00:00:00 2001 From: Tom Brow Date: Thu, 5 Nov 2026 17:23:59 -0800 Subject: [PATCH] test(mobile): drop the video preview step removed with native frame loading (#9164) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes red main. https://github.com/block/buzz/pull/9144 added a step to the expired-assertion journey in `native_media_headers_test` that loads a posterless video preview through `videoPreviewFrameLoaderProvider`. https://github.com/block/buzz/pull/9138 merged around the same time and replaced native first-frame loading with a static placeholder, removing that provider, so `flutter analyze` now fails on main with `Undefined name 'videoPreviewFrameLoaderProvider'`. Posterless previews no longer fetch anything natively, so the step has nothing left to guard. This deletes it along with its fake video player, restoring the test file to its state before #9144. ### Validation - `just mobile-check` and `just mobile-test` pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Tom Brow Co-authored-by: Tom Brow --- .../hosted/native_media_headers_test.dart | 48 ------------------- 1 file changed, 48 deletions(-) diff --git a/mobile/test/shared/hosted/native_media_headers_test.dart b/mobile/test/shared/hosted/native_media_headers_test.dart index b864c90ab6..ad88133c01 100644 --- a/mobile/test/shared/hosted/native_media_headers_test.dart +++ b/mobile/test/shared/hosted/native_media_headers_test.dart @@ -1,13 +1,10 @@ -import 'package:buzz/features/channels/message_content.dart'; import 'package:buzz/shared/hosted/builderlab_account.dart'; import 'package:buzz/shared/hosted/hosted_relay_auth.dart'; import 'package:buzz/shared/hosted/native_media_headers.dart'; import 'package:buzz/shared/relay/relay.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:nostr/nostr.dart' as nostr; -import 'package:video_player_platform_interface/video_player_platform_interface.dart'; final _nsec = nostr.Keys.generate().nsec; @@ -58,7 +55,6 @@ ProviderContainer _container(HostedRelayAuth hosted) => ProviderContainer( ); void main() { - TestWidgetsFlutterBinding.ensureInitialized(); test('native media headers add the relay assertion only for relay media', () { final hosted = _CachedHostedRelayAuth(); addTearDown(hosted.dispose); @@ -108,24 +104,6 @@ void main() { expect(headers['Nostr-Federated-Identity'], 'Bearer fresh-token'); expect(hosted.requested, [Uri.parse(url)]); - // A posterless video's first-frame preview hands the native player the - // renewed assertion too. - const videoUrl = 'https://relay.example/media/clip.mp4'; - final player = _HeaderRecordingVideoPlayer(); - final previousPlayer = VideoPlayerPlatform.instance; - VideoPlayerPlatform.instance = player; - addTearDown(() => VideoPlayerPlatform.instance = previousPlayer); - expect( - await container.read(videoPreviewFrameLoaderProvider)(videoUrl), - isNull, - ); - expect(player.headers.single['Authorization'], startsWith('Nostr ')); - expect( - player.headers.single['Nostr-Federated-Identity'], - 'Bearer fresh-token', - ); - expect(hosted.requested.last, Uri.parse(videoUrl)); - // A failed renewal still sends the media proof, and the relay decides. final failing = _ExpiredHostedRelayAuth(fail: true); addTearDown(failing.dispose); @@ -138,29 +116,3 @@ void main() { expect(fallback, isNot(contains('Nostr-Federated-Identity'))); }); } - -/// Records the headers each native player is created with, then fails its -/// initialization so the preview loader gives up. -class _HeaderRecordingVideoPlayer extends VideoPlayerPlatform { - final headers = >[]; - - @override - Future init() async {} - - @override - Future setMixWithOthers(bool mixWithOthers) async {} - - @override - Future createWithOptions(VideoCreationOptions options) async { - headers.add(options.dataSource.httpHeaders); - return headers.length; - } - - @override - Stream videoEventsFor(int playerId) => Stream.error( - PlatformException(code: 'VideoError', message: 'Fake init failure'), - ); - - @override - Future dispose(int playerId) async {} -}