File tree Expand file tree Collapse file tree
packages/cloud_functions/cloud_functions_platform_interface/lib/src
tests/integration_test/cloud_functions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ class TimeLimit extends AbortSignal {
5353/// ```dart
5454/// final signal = HttpsCallableOptions(webAbortSignal: Abort('User exited'));
5555/// ```
56-
5756class Abort extends AbortSignal {
5857 final Object ? reason;
5958 Abort ([this .reason]);
@@ -74,7 +73,6 @@ class Abort extends AbortSignal {
7473/// ]),
7574/// );
7675/// ```
77-
7876class Any extends AbortSignal {
7977 final List <AbortSignal > signals;
8078 Any (this .signals);
Original file line number Diff line number Diff line change @@ -384,7 +384,7 @@ void main() {
384384 });
385385
386386 test (
387- 'times out when aborted with TimeLimit signal' ,
387+ 'throws error when aborted with TimeLimit signal' ,
388388 () async {
389389 final instance = FirebaseFunctions .instance;
390390 instance.useFunctionsEmulator ('localhost' , 5001 );
@@ -404,7 +404,7 @@ void main() {
404404 },
405405 onError: (error) {
406406 if (error is FirebaseFunctionsException ) {
407- expect (error.code, equals ('deadline-exceeded ' ));
407+ expect (error.code, equals ('internal ' ));
408408 completer.complete ();
409409 } else {
410410 completer.completeError ('Unexpected error type: $error ' );
@@ -416,6 +416,29 @@ void main() {
416416 },
417417 skip: ! kIsWeb,
418418 );
419+
420+ test (
421+ 'throws error when aborted with Abort signal' ,
422+ () async {
423+ final completer = Completer <void >();
424+
425+ callable.stream ().listen (
426+ (data) {
427+ completer.completeError ('Should have thrown' );
428+ },
429+ onError: (error) {
430+ if (error is FirebaseFunctionsException ) {
431+ expect (error.code, equals ('internal' ));
432+ completer.complete ();
433+ } else {
434+ completer.completeError ('Unexpected error type: $error ' );
435+ }
436+ },
437+ );
438+ await completer.future;
439+ },
440+ skip: ! kIsWeb,
441+ );
419442 });
420443 });
421444}
You can’t perform that action at this time.
0 commit comments