Files
IKAR/test/video_quality_gesture_test.dart
sevenhill 1ef2b7420e
Tests / test (push) Canceled after 0s
Build Android (FCM) / build-android-fcm (push) Canceled after 0s
Build Android / build-android (push) Canceled after 0s
Build iOS / build-ios (push) Canceled after 0s
Build Linux / build-linux (push) Canceled after 0s
Build macOS / build-macos (push) Canceled after 0s
Build Windows / build-windows (push) Canceled after 0s
Native crypto / native-crypto (push) Canceled after 0s
Release (main) / android (oneme) (push) Canceled after 0s
Release (main) / android (qlyra) (push) Canceled after 0s
Release (main) / windows (push) Canceled after 0s
Release (main) / linux (push) Canceled after 0s
Release (main) / macos (push) Canceled after 0s
Release (main) / ios (push) Canceled after 0s
Release (main) / release (push) Canceled after 0s
Port Komet UI improvements and implement IKAR ghost mode
Adapt video editing, decrypted message actions, custom themes and gestures from PR 166. Track visible server presence per session and preserve delivery for invisible clients.
2026-10-07 22:07:05 +03:00

83 lines
3.1 KiB
Dart

import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:ikar/frontend/widgets/attachment/editor_common.dart';
import 'package:ikar/frontend/widgets/attachment/video_edit.dart';
import 'package:ikar/frontend/widgets/attachment/video_editor.dart';
import 'package:ikar/l10n/app_localizations.dart';
void main() {
testWidgets(
'quality endpoints remain reachable outside Android gesture edges',
(tester) async {
tester.view.physicalSize = const Size(360, 640);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.resetPhysicalSize);
addTearDown(tester.view.resetDevicePixelRatio);
final recorder = ui.PictureRecorder();
final canvas = Canvas(recorder);
canvas.drawColor(Colors.blue, BlendMode.src);
final picture = recorder.endRecording();
final image = picture.toImageSync(32, 32);
addTearDown(image.dispose);
addTearDown(picture.dispose);
int? selected;
await tester.pumpWidget(
MaterialApp(
locale: const Locale('ru'),
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
builder: (context, child) => MediaQuery(
data: MediaQuery.of(context).copyWith(
systemGestureInsets: const EdgeInsets.only(left: 60, right: 70),
),
child: child!,
),
home: Scaffold(
body: Builder(
builder: (context) => TextButton(
onPressed: () => Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (_) => VideoQualityEditor(
frame: image,
geometry: VideoGeometry.resolve(
null,
const Size(720, 1280),
),
adjust: ColorAdjust(),
options: const [360, 480, 720],
selected: 480,
fps: 30,
duration: const Duration(seconds: 2),
onPreview: (result) async => selected = result,
),
),
),
child: const Text('open'),
),
),
),
),
);
await tester.tap(find.text('open'));
await tester.pumpAndSettle();
final slider = find.byWidgetPredicate(
(widget) =>
widget is GestureDetector &&
widget.onHorizontalDragUpdate != null &&
widget.child is CustomPaint,
);
expect(slider, findsOneWidget);
final bounds = tester.getRect(slider);
expect(bounds.width, 360);
expect(bounds.height, greaterThanOrEqualTo(48));
await tester.tapAt(Offset(bounds.right - 80, bounds.center.dy));
await tester.pump();
await tester.tap(find.text('ГОТОВО'));
await tester.pumpAndSettle();
expect(selected, 720);
expect(tester.takeException(), isNull);
},
);
}