@@ -230,7 +230,10 @@ class SessionStartEventTests: XCTestCase {
230
230
let event = SessionStartEvent ( sessionInfo: sessionInfo, appInfo: appInfo, time: time)
231
231
232
232
// These fields will not be filled in when Crashlytics is installed
233
- event. setRestrictedFields ( subscriber: . Crashlytics, appInfo: appInfo)
233
+ event. set ( subscriber: . Crashlytics, isDataCollectionEnabled: true , appInfo: appInfo)
234
+
235
+ // They should also not be filled in when Performance data collection is disabled
236
+ event. set ( subscriber: . Performance, isDataCollectionEnabled: false , appInfo: appInfo)
234
237
235
238
// Expect empty because Crashlytics is installed, but not Perf
236
239
testProtoAndDecodedProto ( sessionEvent: event) { proto in
@@ -250,7 +253,7 @@ class SessionStartEventTests: XCTestCase {
250
253
}
251
254
252
255
// These fields will only be filled in when the Perf SDK is installed
253
- event. setRestrictedFields ( subscriber: . Performance, appInfo: appInfo)
256
+ event. set ( subscriber: . Performance, isDataCollectionEnabled : true , appInfo: appInfo)
254
257
255
258
// Now the field should be set with the real thing
256
259
testProtoAndDecodedProto ( sessionEvent: event) { proto in
@@ -314,7 +317,7 @@ class SessionStartEventTests: XCTestCase {
314
317
let event = SessionStartEvent ( sessionInfo: sessionInfo, appInfo: appInfo, time: time)
315
318
316
319
// These fields will only be filled in when the Perf SDK is installed
317
- event. setRestrictedFields ( subscriber: . Performance, appInfo: appInfo)
320
+ event. set ( subscriber: . Performance, isDataCollectionEnabled : true , appInfo: appInfo)
318
321
319
322
testProtoAndDecodedProto ( sessionEvent: event) { proto in
320
323
XCTAssertEqual (
@@ -399,7 +402,7 @@ class SessionStartEventTests: XCTestCase {
399
402
let event = SessionStartEvent ( sessionInfo: sessionInfo, appInfo: appInfo, time: time)
400
403
401
404
// These fields will only be filled in when the Perf SDK is installed
402
- event. setRestrictedFields ( subscriber: . Performance, appInfo: appInfo)
405
+ event. set ( subscriber: . Performance, isDataCollectionEnabled : true , appInfo: appInfo)
403
406
404
407
testProtoAndDecodedProto ( sessionEvent: event) { proto in
405
408
XCTAssertEqual (
@@ -493,7 +496,7 @@ class SessionStartEventTests: XCTestCase {
493
496
let event = SessionStartEvent ( sessionInfo: sessionInfo, appInfo: appInfo, time: time)
494
497
495
498
// These fields will only be filled in when the Perf SDK is installed
496
- event. setRestrictedFields ( subscriber: . Performance, appInfo: appInfo)
499
+ event. set ( subscriber: . Performance, isDataCollectionEnabled : true , appInfo: appInfo)
497
500
498
501
testProtoAndDecodedProto ( sessionEvent: event) { proto in
499
502
XCTAssertEqual (
0 commit comments