test(android): inspect probe diagnostics without public transport API

Use a test-owned MethodChannel with the explicit wire contract version to capture malformed native probe metadata. Preserve the diagnostic fallback after raw transport methods were removed from the public runtime facade.

Validation: host static analysis passed. The Android device regression was not run on this macOS host.
This commit is contained in:
lingjhf committed 2026-10-11 15:29:44 +08:00
1 parent 7ebe0c8e2e
commit 796a3852a2
1 file changed
+7 -1
@@ -22,6 +22,7 @@ import 'package:cutdex_sdk/timeline/engine.dart';
import 'package:cutdex_sdk/timeline/model.dart'; import 'package:cutdex_sdk/timeline/model.dart';
import 'package:drift/native.dart'; import 'package:drift/native.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart'; import 'package:integration_test/integration_test.dart';
@@ -215,7 +216,12 @@ void main() {
try { try {
info = await runtime.probe(media); info = await runtime.probe(media);
} catch (_) { } catch (_) {
final raw = await runtime.invoke('probe', {'media': media.toMap()}); // This diagnostic test deliberately inspects the native wire response.
final raw = await const MethodChannel('cutdex_runtime')
.invokeMethod<Object?>('probe', {
'contractVersion': 1,
'media': media.toMap(),
});
result['rawProbeMetadata'] = raw; result['rawProbeMetadata'] = raw;
// Preserve the actual wire-contract failure in the device report. // Preserve the actual wire-contract failure in the device report.
MediaInfo.fromMap(raw! as Map); MediaInfo.fromMap(raw! as Map);