fix(android): wire exact preview startup and device benchmarks
Gitea CI / Check code and tests (pull_request) Successful in 11m6s
Gitea CI / Build Android APK (pull_request) Successful in 5m15s
Gitea CI / Build Windows x64 app (pull_request) Successful in 2m41s
Gitea CI / Audit and package Windows x64 (pull_request) Successful in 1m2s
Gitea CI / Assemble and validate CI artifacts (pull_request) Successful in 51s
Gitea CI / Gitea CI passed (pull_request) Successful in 2s
Gitea CI / Check code and tests (pull_request) Successful in 11m6s
Gitea CI / Build Android APK (pull_request) Successful in 5m15s
Gitea CI / Build Windows x64 app (pull_request) Successful in 2m41s
Gitea CI / Audit and package Windows x64 (pull_request) Successful in 1m2s
Gitea CI / Assemble and validate CI artifacts (pull_request) Successful in 51s
Gitea CI / Gitea CI passed (pull_request) Successful in 2s
This commit is contained in:
1 parent
b4cb12cbe3
commit
64a3a5b547
11 files changed
+1577
-30
No files matched your search
@@ -0,0 +1,589 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cutdex/app/editor_theme.dart';
|
||||
import 'package:cutdex/features/editor/editor_page.dart';
|
||||
import 'package:cutdex/features/preview/preview_panel.dart';
|
||||
import 'package:cutdex/integrations/platform/device_experience.dart';
|
||||
import 'package:cutdex/l10n/app_localizations.dart';
|
||||
import 'package:cutdex/persistence/app_database.dart';
|
||||
import 'package:cutdex/workspace/project_state.dart';
|
||||
import 'package:cutdex/workspace/projects.dart';
|
||||
import 'package:cutdex/workspace/timeline_provider.dart';
|
||||
import 'package:cutdex_sdk/editor.dart';
|
||||
import 'package:cutdex_sdk/preview.dart';
|
||||
import 'package:cutdex_sdk/project.dart';
|
||||
import 'package:cutdex_sdk/runtime.dart';
|
||||
import 'package:cutdex_sdk/timeline/layout.dart';
|
||||
import 'package:cutdex_sdk/timeline/model.dart';
|
||||
import 'package:cutdex_sdk/timeline_ui.dart';
|
||||
import 'package:drift/native.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:integration_test/integration_test.dart';
|
||||
|
||||
import '../test/support/preview_fixture.dart';
|
||||
|
||||
void main() {
|
||||
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive;
|
||||
const source = String.fromEnvironment('CUTDEX_TEST_SOURCE');
|
||||
const output = String.fromEnvironment('CUTDEX_TEST_REPORT');
|
||||
testWidgets(
|
||||
'Android production workspace navigation and exact-stop timing',
|
||||
(tester) async {
|
||||
expect(Platform.isAndroid, isTrue);
|
||||
final file = File(source);
|
||||
final before = await file.stat();
|
||||
expect(before.size, greaterThan(0));
|
||||
final report = File(output);
|
||||
await report.parent.create(recursive: true);
|
||||
final result = <String, Object?>{
|
||||
'status': 'running',
|
||||
'source': source,
|
||||
'sourceBytes': before.size,
|
||||
'buildMode': const bool.fromEnvironment('dart.vm.product')
|
||||
? 'release'
|
||||
: const bool.fromEnvironment('dart.vm.profile')
|
||||
? 'profile'
|
||||
: 'debug',
|
||||
'scope': 'Production EditorWorkspace, Projects, preview and real touch ruler input; isolated project/database',
|
||||
'measurement': 'Native queued-frame counters and content timestamp, not physical display scanout',
|
||||
'switches': <Map<String, Object?>>[],
|
||||
'seeks': <Map<String, Object?>>[],
|
||||
'drags': <Map<String, Object?>>[],
|
||||
'heldRelease': <Map<String, Object?>>[],
|
||||
};
|
||||
void save() => report.writeAsStringSync(
|
||||
const JsonEncoder.withIndent(' ').convert(result),
|
||||
);
|
||||
save();
|
||||
final runtime = CutdexRuntime();
|
||||
final info = await runtime.probe(
|
||||
MediaReference(id: 'media', uri: file.uri),
|
||||
);
|
||||
result['durationSeconds'] = info.duration.seconds;
|
||||
final fixture = await createPreviewFixture(
|
||||
file.uri,
|
||||
hasAudio: info.audioTrackCount > 0,
|
||||
clipDuration: RationalTime(
|
||||
info.duration.numerator,
|
||||
info.duration.denominator,
|
||||
),
|
||||
renderSize: {'width': 1280, 'height': 720},
|
||||
);
|
||||
final document = await fixture.workspace.project!.loadTimeline('project');
|
||||
for (final id in ['cold', 'third']) {
|
||||
await fixture.workspace.project!.saveTimeline(
|
||||
TimelineDocument(
|
||||
id: id,
|
||||
name: id,
|
||||
sequences: document.sequences,
|
||||
defaultSequenceId: document.defaultSequenceId,
|
||||
payloads: document.payloads,
|
||||
settings: document.settings,
|
||||
),
|
||||
);
|
||||
}
|
||||
await fixture.workspace.close();
|
||||
final database = AppDatabase(NativeDatabase.memory());
|
||||
final container = ProviderContainer(
|
||||
overrides: [appDatabaseProvider.overrideWithValue(database)],
|
||||
);
|
||||
final projects = container.read(projectsProvider.notifier);
|
||||
Future<void> until(
|
||||
bool Function() ready,
|
||||
String label, {
|
||||
int seconds = 60,
|
||||
}) async {
|
||||
final clock = Stopwatch()..start();
|
||||
while (!ready()) {
|
||||
if (clock.elapsed.inSeconds >= seconds) throw TimeoutException(label);
|
||||
await tester.pump();
|
||||
await Future<void>.delayed(const Duration(milliseconds: 16));
|
||||
}
|
||||
await tester.pump();
|
||||
}
|
||||
|
||||
Future<void> advance(int milliseconds) async {
|
||||
final clock = Stopwatch()..start();
|
||||
while (clock.elapsedMilliseconds < milliseconds) {
|
||||
await tester.pump();
|
||||
await Future<void>.delayed(const Duration(milliseconds: 16));
|
||||
}
|
||||
}
|
||||
|
||||
PreviewController? activePreview() {
|
||||
final state = container.read(projectsProvider).value;
|
||||
if (state?.timeline == null || state!.openingTimelineId != null) {
|
||||
return null;
|
||||
}
|
||||
return container
|
||||
.read(
|
||||
editorPreviewProvider(
|
||||
state.activeProject!.id,
|
||||
state.timeline!.id,
|
||||
),
|
||||
)
|
||||
.value;
|
||||
}
|
||||
|
||||
const nativeChannel = MethodChannel('cutdex_runtime');
|
||||
const expectedDecoder = String.fromEnvironment('CUTDEX_TEST_DECODER');
|
||||
Future<Map<String, dynamic>> diagnostic(PreviewController preview) async {
|
||||
final value = (await nativeChannel.invokeMapMethod<String, dynamic>(
|
||||
'previewDiagnostics',
|
||||
{'contractVersion': 1, 'sessionId': preview.session!.id},
|
||||
))!;
|
||||
if (expectedDecoder.isNotEmpty) {
|
||||
final backends = value['decoderBackends'] as Map?;
|
||||
// Diagnostics also run from a timer while WidgetTester.pump is active.
|
||||
expectSync(value['executionBackend'], 'direct');
|
||||
expectSync(backends, isNotEmpty);
|
||||
expectSync(backends!.values, everyElement(expectedDecoder));
|
||||
expectSync(value['decoderSelectionReasons'], isNotEmpty);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
int frames(Map<String, dynamic> value) =>
|
||||
int.tryParse('${value['presentedVideoFrameCount']}') ?? 0;
|
||||
double sourcePts(Map<String, dynamic> value) {
|
||||
final time = value['presentedSourceFrameTime'] as Map?;
|
||||
expect(time, isNotNull, reason: 'Actual source PTS must be available');
|
||||
return int.parse('${time!['numerator']}') /
|
||||
(time['denominator'] as num);
|
||||
}
|
||||
|
||||
void expectExactSource(Map<String, dynamic> value, int tick) {
|
||||
final target = tick / TimelineClock.ticksPerSecond;
|
||||
final pts = sourcePts(value);
|
||||
// This original is untrimmed CFR 2997/100, so the preceding source
|
||||
// frame owns this sample. Allow only microsecond timestamp precision.
|
||||
expect(pts, lessThanOrEqualTo(target + 0.000002));
|
||||
expect(target - pts, lessThan(100 / 2997 + 0.000002));
|
||||
}
|
||||
|
||||
try {
|
||||
await SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.landscapeLeft,
|
||||
]);
|
||||
expect(
|
||||
await projects.open(
|
||||
'${fixture.directory.path}/Preview.cutdex',
|
||||
timelineId: 'project',
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
await tester.pumpWidget(
|
||||
UncontrolledProviderScope(
|
||||
container: container,
|
||||
child: MaterialApp(
|
||||
theme: EditorTheme.penDark,
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
locale: const Locale('zh'),
|
||||
home: const Scaffold(body: _Workspace()),
|
||||
),
|
||||
),
|
||||
);
|
||||
await until(
|
||||
() =>
|
||||
activePreview()?.ready == true &&
|
||||
activePreview()?.session != null,
|
||||
'initial preview ready',
|
||||
);
|
||||
await until(
|
||||
() =>
|
||||
(activePreview()!.session!.snapshot?.presentedVideoFrameCount ??
|
||||
0) >
|
||||
0,
|
||||
'initial native frame',
|
||||
);
|
||||
expect(activePreview()!.error, isNull);
|
||||
result['initialNative'] = await diagnostic(activePreview()!);
|
||||
save();
|
||||
final projectId = container
|
||||
.read(projectsProvider)
|
||||
.requireValue
|
||||
.activeProject!
|
||||
.id;
|
||||
final switches = result['switches']! as List<Map<String, Object?>>;
|
||||
Future<void> switchTo(String id, String name) async {
|
||||
final workspaceElement = find
|
||||
.byType(EditorWorkspace)
|
||||
.evaluate()
|
||||
.single;
|
||||
final clock = Stopwatch()..start();
|
||||
double? dataMs, uiMs;
|
||||
final startupTrace = <Map<String, Object?>>[];
|
||||
final traceTimer = Timer.periodic(const Duration(milliseconds: 100), (
|
||||
_,
|
||||
) {
|
||||
final controller = activePreview();
|
||||
final views = find.byType(RuntimePreview).evaluate();
|
||||
final row = <String, Object?>{
|
||||
'ms': clock.elapsedMicroseconds / 1000,
|
||||
'pending': container
|
||||
.read(projectsProvider)
|
||||
.value
|
||||
?.openingTimelineId,
|
||||
'controller': controller != null,
|
||||
'ready': controller?.ready,
|
||||
'durationTick': controller?.durationTick,
|
||||
'session': controller?.session?.id,
|
||||
'views': views
|
||||
.map((e) => (e.widget as RuntimePreview).session.id)
|
||||
.toList(),
|
||||
};
|
||||
startupTrace.add(row);
|
||||
});
|
||||
final subscription = container.listen(projectsProvider, (_, next) {
|
||||
if (next.value?.timeline?.id == id &&
|
||||
next.value?.openingTimelineId == null) {
|
||||
dataMs ??= clock.elapsedMicroseconds / 1000;
|
||||
}
|
||||
});
|
||||
void observeFrame(Duration _) {
|
||||
final workspace = workspaceElement.widget as EditorWorkspace;
|
||||
if (workspace.timelineId == id) {
|
||||
uiMs ??= clock.elapsedMicroseconds / 1000;
|
||||
}
|
||||
if (uiMs == null && clock.elapsedMilliseconds < 60000) {
|
||||
WidgetsBinding.instance.addPostFrameCallback(observeFrame);
|
||||
WidgetsBinding.instance.scheduleFrame();
|
||||
}
|
||||
}
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback(observeFrame);
|
||||
try {
|
||||
await tester.tap(find.byKey(ValueKey('timeline-tab-$id')));
|
||||
await until(() => uiMs != null, 'selected UI $id');
|
||||
await until(
|
||||
() =>
|
||||
dataMs != null &&
|
||||
activePreview()?.ready == true &&
|
||||
activePreview()?.session != null,
|
||||
'metadata/preview $id',
|
||||
);
|
||||
result['switchBeforeFirstFrame'] = {
|
||||
'timelineId': id,
|
||||
'native': await diagnostic(activePreview()!),
|
||||
};
|
||||
save();
|
||||
await until(
|
||||
() =>
|
||||
(activePreview()!
|
||||
.session!
|
||||
.snapshot
|
||||
?.presentedVideoFrameCount ??
|
||||
0) >
|
||||
0,
|
||||
'native frame $id',
|
||||
);
|
||||
switches.add({
|
||||
'scenario': name,
|
||||
'uiPostFrameMs': uiMs,
|
||||
'dataMs': dataMs,
|
||||
'nativeFrameObservedMs': clock.elapsedMicroseconds / 1000,
|
||||
'startupTrace': startupTrace,
|
||||
});
|
||||
expect(activePreview()!.error, isNull);
|
||||
save();
|
||||
} finally {
|
||||
traceTimer.cancel();
|
||||
subscription.close();
|
||||
}
|
||||
}
|
||||
|
||||
await switchTo('cold', 'cold');
|
||||
for (var i = 0; i < 3; i++) {
|
||||
await switchTo('project', 'warm-return-$i');
|
||||
await switchTo('cold', 'warm-target-$i');
|
||||
}
|
||||
final rapid = <String>[];
|
||||
final rapidSub = container.listen(projectsProvider, (_, next) {
|
||||
if (next.value?.visibleTimelineId case final id?) rapid.add(id);
|
||||
});
|
||||
for (final id in ['third', 'project', 'cold', 'project', 'cold']) {
|
||||
await tester.tap(find.byKey(ValueKey('timeline-tab-$id')));
|
||||
await tester.pump();
|
||||
await Future<void>.delayed(const Duration(milliseconds: 16));
|
||||
expect(
|
||||
container.read(projectsProvider).requireValue.visibleTimelineId,
|
||||
id,
|
||||
);
|
||||
}
|
||||
await advance(1000);
|
||||
rapidSub.close();
|
||||
expect(
|
||||
container.read(projectsProvider).requireValue.timeline!.id,
|
||||
'cold',
|
||||
);
|
||||
result['rapidSelection'] = rapid;
|
||||
await until(
|
||||
() => activePreview()?.ready == true,
|
||||
'preview after rapid selection',
|
||||
);
|
||||
final preview = activePreview()!;
|
||||
final session = await container.read(
|
||||
editorTimelineProvider(projectId, 'cold').future,
|
||||
);
|
||||
final sequence = session.activeSequenceId!;
|
||||
final view = session.view(sequence);
|
||||
Future<void> seek(int frame) => preview.controlPreview(
|
||||
sequence,
|
||||
PreviewAction.seek,
|
||||
at: CommandTime(frame, 30),
|
||||
);
|
||||
final seeks = result['seeks']! as List<Map<String, Object?>>;
|
||||
for (final frame in [1800, 60000, 60001, 60002, 60001]) {
|
||||
final before = await diagnostic(preview);
|
||||
final clock = Stopwatch()..start();
|
||||
await seek(frame);
|
||||
final after = await diagnostic(preview);
|
||||
seeks.add({
|
||||
'frame': frame,
|
||||
'acknowledgmentMs': clock.elapsedMicroseconds / 1000,
|
||||
'frames': frames(after) - frames(before),
|
||||
'native': after,
|
||||
});
|
||||
expect(preview.error, isNull);
|
||||
save();
|
||||
}
|
||||
final drags = result['drags']! as List<Map<String, Object?>>;
|
||||
for (var round = 0; round < 2; round++) {
|
||||
for (final local in [false, true]) {
|
||||
view.fitTimeline();
|
||||
await advance(200);
|
||||
final rulerFinder = find.byType(TimelineRuler);
|
||||
final ruler = tester.renderObject<RenderBox>(rulerFinder);
|
||||
final viewport = TimelineViewportRect(
|
||||
width: ruler.size.width,
|
||||
height: ruler.size.height,
|
||||
);
|
||||
final durationFrames = (info.duration.seconds * 30).floor();
|
||||
if (local) {
|
||||
view.setCamera(
|
||||
TimelineCamera(
|
||||
baseTick: TimelineClock.standard.toTicks(
|
||||
RationalTime(59980, 30),
|
||||
),
|
||||
pixelsPerTick:
|
||||
4 / TimelineClock.standard.toTicks(RationalTime(1, 30)),
|
||||
verticalOffset: view.camera.verticalOffset,
|
||||
),
|
||||
);
|
||||
await advance(100);
|
||||
}
|
||||
Offset position(int frame) => ruler.localToGlobal(
|
||||
Offset(
|
||||
view.camera.screenXForTick(
|
||||
TimelineClock.standard.toTicks(RationalTime(frame, 30)),
|
||||
viewport,
|
||||
),
|
||||
ruler.size.height / 2,
|
||||
),
|
||||
);
|
||||
final startFrame = local ? 60000 : (durationFrames * .05).round();
|
||||
await seek(startFrame);
|
||||
await advance(150);
|
||||
var initial = await diagnostic(preview);
|
||||
final observations = <Map<String, Object?>>[];
|
||||
final inputs = <Map<String, Object?>>[];
|
||||
final clock = Stopwatch()..start();
|
||||
Future<void>? pending;
|
||||
Object? sampleError;
|
||||
void sample() {
|
||||
if (pending != null) return;
|
||||
pending = diagnostic(preview)
|
||||
.then((d) {
|
||||
observations.add({
|
||||
'ms': clock.elapsedMicroseconds / 1000,
|
||||
...d,
|
||||
});
|
||||
})
|
||||
.catchError((Object e) {
|
||||
sampleError = e;
|
||||
})
|
||||
.whenComplete(() => pending = null);
|
||||
}
|
||||
|
||||
final gesture = await tester.startGesture(
|
||||
position(startFrame),
|
||||
kind: PointerDeviceKind.touch,
|
||||
);
|
||||
// Acquire the real ruler's drag recognizer before measuring movement.
|
||||
await gesture.moveBy(const Offset(30, 0));
|
||||
await tester.pump();
|
||||
expect(view.isScrubbing, isTrue);
|
||||
await gesture.moveTo(position(startFrame));
|
||||
await advance(350);
|
||||
initial = await diagnostic(preview);
|
||||
clock.reset();
|
||||
final timer = Timer.periodic(
|
||||
const Duration(milliseconds: 20),
|
||||
(_) => sample(),
|
||||
);
|
||||
for (var i = 0; i < 120; i++) {
|
||||
final dueUs = (i * 1000000 / 60).round();
|
||||
final remaining = dueUs - clock.elapsedMicroseconds;
|
||||
if (remaining > 0) {
|
||||
await Future<void>.delayed(Duration(microseconds: remaining));
|
||||
}
|
||||
final phase = i < 60 ? i : 119 - i;
|
||||
final target = local
|
||||
? 60000 + (i % 40 < 20 ? i % 40 : 39 - i % 40)
|
||||
: (durationFrames * (.05 + .9 * phase / 59)).round();
|
||||
await gesture.moveTo(position(target));
|
||||
inputs.add({
|
||||
'ms': clock.elapsedMicroseconds / 1000,
|
||||
'dueMs': dueUs / 1000,
|
||||
'idealFrame': target,
|
||||
'actualTick': view.playheadTick,
|
||||
});
|
||||
}
|
||||
final releaseAt = clock.elapsedMicroseconds / 1000;
|
||||
final finalTick = view.playheadTick;
|
||||
await gesture.up();
|
||||
await tester.pump();
|
||||
await preview.waitForPendingPreview().timeout(
|
||||
const Duration(seconds: 60),
|
||||
);
|
||||
final settled = await diagnostic(preview);
|
||||
final settledMs = clock.elapsedMicroseconds / 1000;
|
||||
await advance(500);
|
||||
final frozen = await diagnostic(preview);
|
||||
timer.cancel();
|
||||
await pending;
|
||||
expect(sampleError, isNull);
|
||||
expect(preview.error, isNull);
|
||||
final snapshot = await preview.session!.refresh();
|
||||
final clockTick =
|
||||
(BigInt.from(snapshot.position.numerator) *
|
||||
BigInt.from(TimelineClock.ticksPerSecond) ~/
|
||||
BigInt.from(snapshot.position.denominator))
|
||||
.toInt();
|
||||
expectExactSource(settled, finalTick);
|
||||
expect(
|
||||
(clockTick - finalTick).abs(),
|
||||
lessThanOrEqualTo(TimelineClock.ticksPerSecond ~/ 1000000),
|
||||
);
|
||||
drags.add({
|
||||
'round': round,
|
||||
'scenario': local ? 'local-20-frame' : 'fit-entire-source',
|
||||
'viewportWidth': ruler.size.width,
|
||||
'inputs': inputs,
|
||||
'observations': observations,
|
||||
'before': initial,
|
||||
'settled': settled,
|
||||
'frozen': frozen,
|
||||
'releaseAtMs': releaseAt,
|
||||
'settledAtMs': settledMs,
|
||||
'releaseWaitMs': settledMs - releaseAt,
|
||||
'finalTick': finalTick,
|
||||
'clockTick': clockTick,
|
||||
'postSettleFrames': frames(frozen) - frames(settled),
|
||||
});
|
||||
save();
|
||||
}
|
||||
}
|
||||
final ruler = tester.renderObject<RenderBox>(
|
||||
find.byType(TimelineRuler),
|
||||
);
|
||||
final viewport = TimelineViewportRect(
|
||||
width: ruler.size.width,
|
||||
height: ruler.size.height,
|
||||
);
|
||||
Offset heldPosition(int frame) => ruler.localToGlobal(
|
||||
Offset(
|
||||
view.camera.screenXForTick(
|
||||
TimelineClock.standard.toTicks(RationalTime(frame, 30)),
|
||||
viewport,
|
||||
),
|
||||
ruler.size.height / 2,
|
||||
),
|
||||
);
|
||||
await seek(60000);
|
||||
final hold = await tester.startGesture(
|
||||
heldPosition(60000),
|
||||
kind: PointerDeviceKind.touch,
|
||||
);
|
||||
await hold.moveBy(const Offset(30, 0));
|
||||
await tester.pump();
|
||||
await hold.moveTo(heldPosition(60010));
|
||||
await advance(1000);
|
||||
final heldTick = view.playheadTick;
|
||||
final heldBefore = await diagnostic(preview);
|
||||
final releaseClock = Stopwatch()..start();
|
||||
await hold.up();
|
||||
await tester.pump();
|
||||
await preview.waitForPendingPreview().timeout(
|
||||
const Duration(seconds: 60),
|
||||
);
|
||||
final heldAfter = await diagnostic(preview);
|
||||
final heldReleaseMs = releaseClock.elapsedMicroseconds / 1000;
|
||||
await advance(500);
|
||||
final heldFrozen = await diagnostic(preview);
|
||||
(result['heldRelease']! as List<Map<String, Object?>>).add({
|
||||
'holdMilliseconds': 1000,
|
||||
'targetTick': heldTick,
|
||||
'before': heldBefore,
|
||||
'after': heldAfter,
|
||||
'frozen': heldFrozen,
|
||||
'releaseWaitMs': heldReleaseMs,
|
||||
});
|
||||
save();
|
||||
expectExactSource(heldBefore, heldTick);
|
||||
expectExactSource(heldAfter, heldTick);
|
||||
expect(sourcePts(heldAfter), sourcePts(heldBefore));
|
||||
expect(frames(heldAfter), frames(heldBefore));
|
||||
expect(heldAfter['seekRequestCount'], heldBefore['seekRequestCount']);
|
||||
expect(frames(heldFrozen), frames(heldAfter));
|
||||
expect(tester.takeException(), isNull);
|
||||
final after = await file.stat();
|
||||
expect(after.size, before.size);
|
||||
expect(after.modified, before.modified);
|
||||
result['status'] = 'passed';
|
||||
result['sourceUnchanged'] = true;
|
||||
save();
|
||||
} catch (error, stack) {
|
||||
result['status'] = 'failed';
|
||||
result['error'] = '$error';
|
||||
result['stack'] = '$stack';
|
||||
save();
|
||||
rethrow;
|
||||
} finally {
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
container.dispose();
|
||||
await Future<void>.delayed(const Duration(milliseconds: 300));
|
||||
await database.close();
|
||||
await SystemChrome.setPreferredOrientations([]);
|
||||
}
|
||||
},
|
||||
skip: source.isEmpty || output.isEmpty,
|
||||
timeout: const Timeout(Duration(minutes: 15)),
|
||||
);
|
||||
}
|
||||
|
||||
class _Workspace extends ConsumerWidget {
|
||||
const _Workspace();
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final state = ref.watch(projectsProvider).requireValue;
|
||||
return EditorWorkspace(
|
||||
projectId: state.activeProject!.id,
|
||||
projectName: state.activeProject!.name,
|
||||
timelineId: state.visibleTimelineId!,
|
||||
projectLoading: state.projectBusy,
|
||||
timelineLoading: state.openingTimelineId != null,
|
||||
integratedTitlebar: false,
|
||||
headerLeading: const SizedBox.shrink(),
|
||||
experience: DeviceExperience.tablet,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user