@@ -30,7 +30,7 @@ final class MetricsCallbackTests: PMHTTPTestCase {
30
30
}
31
31
var task : HTTPManagerTask ?
32
32
let expectation = self . expectation ( description: " task metrics " )
33
- HTTP . metricsCallback = . init( queue: nil , callback : { ( task_, metrics) in
33
+ HTTP . metricsCallback = . init( queue: nil , handler : { ( task_, networkTask , metrics) in
34
34
XCTAssert ( task === task_, " unexpected task " )
35
35
expectation. fulfill ( )
36
36
} )
@@ -48,7 +48,7 @@ final class MetricsCallbackTests: PMHTTPTestCase {
48
48
var task : HTTPManagerTask ?
49
49
let operationQueue = OperationQueue ( )
50
50
let expectation = self . expectation ( description: " task metrics " )
51
- HTTP . metricsCallback = . init( queue: operationQueue, callback : { ( task_, metrics) in
51
+ HTTP . metricsCallback = . init( queue: operationQueue, handler : { ( task_, networkTask , metrics) in
52
52
XCTAssertEqual ( OperationQueue . current, operationQueue)
53
53
XCTAssert ( task === task_, " unexpected task " )
54
54
expectation. fulfill ( )
@@ -70,7 +70,7 @@ final class MetricsCallbackTests: PMHTTPTestCase {
70
70
var requestFinished = false
71
71
var task : HTTPManagerTask ?
72
72
let expectation = self . expectation ( description: " task metrics " )
73
- HTTP . metricsCallback = . init( queue: operationQueue, callback : { ( task_, metrics) in
73
+ HTTP . metricsCallback = . init( queue: operationQueue, handler : { ( task_, networkTask , metrics) in
74
74
XCTAssertEqual ( OperationQueue . current, operationQueue)
75
75
XCTAssert ( task === task_, " unexpected task " )
76
76
XCTAssertFalse ( requestFinished, " recieved metrics after task finished " )
@@ -107,7 +107,7 @@ final class MetricsCallbackTests: PMHTTPTestCase {
107
107
let expectation = self . expectation ( description: " task metrics " )
108
108
expectation. expectedFulfillmentCount = 3
109
109
expectation. assertForOverFulfill = true
110
- HTTP . metricsCallback = . init( queue: operationQueue, callback : { ( task_, metrics) in
110
+ HTTP . metricsCallback = . init( queue: operationQueue, handler : { ( task_, networkTask , metrics) in
111
111
XCTAssert ( task === task_, " unexpected task " )
112
112
expectation. fulfill ( )
113
113
} )
@@ -125,7 +125,7 @@ final class MetricsCallbackTests: PMHTTPTestCase {
125
125
completionHandler ( HTTPServer . Response ( status: . ok) )
126
126
}
127
127
expectationForRequestSuccess ( HTTP . request ( GET: " foo " ) , startAutomatically: true )
128
- HTTP . metricsCallback = . init( queue: nil , callback : { ( _, _) in } ) // this resets the session asynchronously
128
+ HTTP . metricsCallback = . init( queue: nil , handler : { ( _ , _, _) in } ) // this resets the session asynchronously
129
129
_ = HTTP . sessionConfiguration // this waits for the session reset to complete
130
130
sema. signal ( )
131
131
waitForExpectations ( timeout: 1 , handler: nil )
@@ -144,7 +144,7 @@ final class MetricsCallbackTests: PMHTTPTestCase {
144
144
expectationForRequestSuccess ( HTTP . request ( GET: " foo " ) , queue: operationQueue, startAutomatically: true )
145
145
let expectation = XCTestExpectation ( description: " task metrics " )
146
146
expectation. isInverted = true
147
- HTTP . metricsCallback = . init( queue: operationQueue, callback : { ( _, _) in
147
+ HTTP . metricsCallback = . init( queue: operationQueue, handler : { ( _ , _, _) in
148
148
expectation. fulfill ( )
149
149
} )
150
150
sema. signal ( )
@@ -160,12 +160,12 @@ final class MetricsCallbackTests: PMHTTPTestCase {
160
160
}
161
161
let expectationFirst = XCTestExpectation ( description: " first task metrics " )
162
162
expectationFirst. isInverted = true
163
- HTTP . metricsCallback = . init( queue: nil , callback : { ( task_, metrics) in
163
+ HTTP . metricsCallback = . init( queue: nil , handler : { ( task_, networkTask , metrics) in
164
164
expectationFirst. fulfill ( )
165
165
} )
166
166
let task = expectationForRequestSuccess ( HTTP . request ( GET: " foo " ) , startAutomatically: false )
167
167
let expectationSecond = self . expectation ( description: " second task metrics " )
168
- HTTP . metricsCallback = . init( queue: nil , callback : { ( task_, metrics) in
168
+ HTTP . metricsCallback = . init( queue: nil , handler : { ( task_, networkTask , metrics) in
169
169
XCTAssert ( task === task_, " unexpected task " )
170
170
expectationSecond. fulfill ( )
171
171
} )
@@ -184,7 +184,7 @@ final class MetricsCallbackTests: PMHTTPTestCase {
184
184
}
185
185
let expectation = XCTestExpectation ( description: " task metrics " )
186
186
expectation. isInverted = true
187
- HTTP . metricsCallback = . init( queue: nil , callback : { ( _, _) in
187
+ HTTP . metricsCallback = . init( queue: nil , handler : { ( _ , _, _) in
188
188
expectation. fulfill ( )
189
189
} )
190
190
let operationQueue = OperationQueue ( )
0 commit comments