@@ -6,6 +6,7 @@ import 'package:package_info_plus/package_info_plus.dart';
6
6
import 'package:sentry/src/platform/platform.dart' ;
7
7
import 'package:sentry/src/dart_exception_type_identifier.dart' ;
8
8
import 'package:sentry_flutter/sentry_flutter.dart' ;
9
+ import 'package:sentry_flutter/src/file_system_transport.dart' ;
9
10
import 'package:sentry_flutter/src/flutter_exception_type_identifier.dart' ;
10
11
import 'package:sentry_flutter/src/integrations/connectivity/connectivity_integration.dart' ;
11
12
import 'package:sentry_flutter/src/integrations/integrations.dart' ;
@@ -70,34 +71,31 @@ void main() {
70
71
});
71
72
72
73
test ('Android' , () async {
73
- List < Integration > integrations = [] ;
74
- Transport transport = MockTransport () ;
74
+ late final SentryFlutterOptions options ;
75
+ late final Transport transport ;
75
76
76
77
final sentryFlutterOptions = defaultTestOptions (
77
78
getPlatformChecker (platform: MockPlatform .android ()))
78
79
..methodChannel = native .channel;
79
80
80
81
await SentryFlutter .init (
81
- (options ) async {
82
- options .dsn = fakeDsn;
83
- options .profilesSampleRate = 1.0 ;
84
- integrations = options.integrations ;
85
- transport = options .transport;
82
+ (o ) async {
83
+ o .dsn = fakeDsn;
84
+ o .profilesSampleRate = 1.0 ;
85
+ options = o ;
86
+ transport = o .transport;
86
87
},
87
88
appRunner: appRunner,
88
89
options: sentryFlutterOptions,
89
90
);
90
91
91
- testTransport (
92
- transport: transport,
93
- hasFileSystemTransport: true ,
94
- );
92
+ expect (transport, isA <FileSystemTransport >());
95
93
96
94
testScopeObserver (
97
95
options: sentryFlutterOptions, expectedHasNativeScopeObserver: true );
98
96
99
97
testConfiguration (
100
- integrations: integrations,
98
+ integrations: options. integrations,
101
99
shouldHaveIntegrations: [
102
100
...androidIntegrations,
103
101
...nativeIntegrations,
@@ -110,49 +108,51 @@ void main() {
110
108
],
111
109
);
112
110
113
- integrations
111
+ options. integrations
114
112
.indexWhere ((element) => element is WidgetsFlutterBindingIntegration );
115
113
116
114
testBefore (
117
- integrations: integrations,
115
+ integrations: options. integrations,
118
116
beforeIntegration: WidgetsFlutterBindingIntegration ,
119
117
afterIntegration: OnErrorIntegration );
120
118
119
+ expect (
120
+ options.eventProcessors.indexOfTypeString ('IoEnricherEventProcessor' ),
121
+ greaterThan (options.eventProcessors
122
+ .indexOfTypeString ('_LoadContextsIntegrationEventProcessor' )));
123
+
121
124
expect (SentryFlutter .native , isNotNull);
122
125
expect (Sentry .currentHub.profilerFactory, isNull);
123
126
124
127
await Sentry .close ();
125
128
}, testOn: 'vm' );
126
129
127
130
test ('iOS' , () async {
128
- List < Integration > integrations = [] ;
129
- Transport transport = MockTransport () ;
131
+ late final SentryFlutterOptions options ;
132
+ late final Transport transport ;
130
133
131
134
final sentryFlutterOptions =
132
135
defaultTestOptions (getPlatformChecker (platform: MockPlatform .iOs ()))
133
136
..methodChannel = native .channel;
134
137
135
138
await SentryFlutter .init (
136
- (options ) async {
137
- options .dsn = fakeDsn;
138
- options .profilesSampleRate = 1.0 ;
139
- integrations = options.integrations ;
140
- transport = options .transport;
139
+ (o ) async {
140
+ o .dsn = fakeDsn;
141
+ o .profilesSampleRate = 1.0 ;
142
+ options = o ;
143
+ transport = o .transport;
141
144
},
142
145
appRunner: appRunner,
143
146
options: sentryFlutterOptions,
144
147
);
145
148
146
- testTransport (
147
- transport: transport,
148
- hasFileSystemTransport: true ,
149
- );
149
+ expect (transport, isA <FileSystemTransport >());
150
150
151
151
testScopeObserver (
152
152
options: sentryFlutterOptions, expectedHasNativeScopeObserver: true );
153
153
154
154
testConfiguration (
155
- integrations: integrations,
155
+ integrations: options. integrations,
156
156
shouldHaveIntegrations: [
157
157
...iOsAndMacOsIntegrations,
158
158
...nativeIntegrations,
@@ -166,14 +166,19 @@ void main() {
166
166
);
167
167
168
168
testBefore (
169
- integrations: integrations,
169
+ integrations: options. integrations,
170
170
beforeIntegration: WidgetsFlutterBindingIntegration ,
171
171
afterIntegration: OnErrorIntegration );
172
172
173
173
expect (SentryFlutter .native , isNotNull);
174
174
expect (Sentry .currentHub.profilerFactory,
175
175
isInstanceOf <SentryNativeProfilerFactory >());
176
176
177
+ expect (
178
+ options.eventProcessors.indexOfTypeString ('IoEnricherEventProcessor' ),
179
+ greaterThan (options.eventProcessors
180
+ .indexOfTypeString ('_LoadContextsIntegrationEventProcessor' )));
181
+
177
182
await Sentry .close ();
178
183
}, testOn: 'vm' );
179
184
@@ -195,10 +200,7 @@ void main() {
195
200
options: sentryFlutterOptions,
196
201
);
197
202
198
- testTransport (
199
- transport: transport,
200
- hasFileSystemTransport: true ,
201
- );
203
+ expect (transport, isA <FileSystemTransport >());
202
204
203
205
testScopeObserver (
204
206
options: sentryFlutterOptions, expectedHasNativeScopeObserver: true );
@@ -244,10 +246,7 @@ void main() {
244
246
options: sentryFlutterOptions,
245
247
);
246
248
247
- testTransport (
248
- transport: transport,
249
- hasFileSystemTransport: false ,
250
- );
249
+ expect (transport, isNot (isA <FileSystemTransport >()));
251
250
252
251
testScopeObserver (
253
252
options: sentryFlutterOptions, expectedHasNativeScopeObserver: true );
@@ -295,10 +294,7 @@ void main() {
295
294
options: sentryFlutterOptions,
296
295
);
297
296
298
- testTransport (
299
- transport: transport,
300
- hasFileSystemTransport: false ,
301
- );
297
+ expect (transport, isNot (isA <FileSystemTransport >()));
302
298
303
299
testScopeObserver (
304
300
options: sentryFlutterOptions, expectedHasNativeScopeObserver: true );
@@ -345,10 +341,7 @@ void main() {
345
341
options: sentryFlutterOptions,
346
342
);
347
343
348
- testTransport (
349
- transport: transport,
350
- hasFileSystemTransport: false ,
351
- );
344
+ expect (transport, isNot (isA <FileSystemTransport >()));
352
345
353
346
testScopeObserver (
354
347
options: sentryFlutterOptions, expectedHasNativeScopeObserver: false );
@@ -396,10 +389,7 @@ void main() {
396
389
options: sentryFlutterOptions,
397
390
);
398
391
399
- testTransport (
400
- transport: transport,
401
- hasFileSystemTransport: false ,
402
- );
392
+ expect (transport, isNot (isA <FileSystemTransport >()));
403
393
404
394
testConfiguration (
405
395
integrations: integrations,
@@ -441,10 +431,7 @@ void main() {
441
431
options: sentryFlutterOptions,
442
432
);
443
433
444
- testTransport (
445
- transport: transport,
446
- hasFileSystemTransport: false ,
447
- );
434
+ expect (transport, isNot (isA <FileSystemTransport >()));
448
435
449
436
testConfiguration (
450
437
integrations: integrations,
@@ -487,10 +474,7 @@ void main() {
487
474
options: sentryFlutterOptions,
488
475
);
489
476
490
- testTransport (
491
- transport: transport,
492
- hasFileSystemTransport: false ,
493
- );
477
+ expect (transport, isNot (isA <FileSystemTransport >()));
494
478
495
479
testConfiguration (
496
480
integrations: integrations,
0 commit comments