From 5a3a1f3c704ea5bcf6271dfe104f964675a43f86 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Sun, 9 Aug 2026 17:50:59 +0200 Subject: [PATCH] fix(ios): drop RunnerTests coverage of the removed Atmos raw EC3 loader RawEc3Loader and its ProbeURLProtocol harness were deleted with the Atmos output diagnostics, but the iOS RunnerTests kept exercising them, so the Apple native reliability job no longer compiled. --- ios/RunnerTests/RunnerTests.swift | 134 ------------------------------ 1 file changed, 134 deletions(-) diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift index c7d388d5..4a4cb918 100644 --- a/ios/RunnerTests/RunnerTests.swift +++ b/ios/RunnerTests/RunnerTests.swift @@ -101,46 +101,6 @@ final class ReleaseTrackingCore: MpvPlayerCoreBase { deinit { onDeinit() } } -final class ProbeURLProtocol: URLProtocol { - private static let lock = NSLock() - private static var startHandler: ((ProbeURLProtocol) -> Void)? - private static var stopHandler: (() -> Void)? - - static func configure( - start: @escaping (ProbeURLProtocol) -> Void, - stop: (() -> Void)? = nil - ) { - lock.lock() - startHandler = start - stopHandler = stop - lock.unlock() - } - - static func reset() { - lock.lock() - startHandler = nil - stopHandler = nil - lock.unlock() - } - - override class func canInit(with request: URLRequest) -> Bool { true } - override class func canonicalRequest(for request: URLRequest) -> URLRequest { request } - - override func startLoading() { - Self.lock.lock() - let handler = Self.startHandler - Self.lock.unlock() - handler?(self) - } - - override func stopLoading() { - Self.lock.lock() - let handler = Self.stopHandler - Self.lock.unlock() - handler?() - } -} - final class MpvPlayerContractTests: XCTestCase { private let failure = NSError( domain: "MpvPlayerContractTests", @@ -480,100 +440,6 @@ final class MpvPlayerContractTests: XCTestCase { XCTAssertFalse(core.validateSideDataDimensions(width: 16_384, height: 16_384)) } - func testRawEc3LoaderBoundsAndIgnoresLateCallbacksForBothModes() { - for finiteLength in [false, true] { - let loader = RawEc3Loader( - source: URL(string: "https://example.invalid/test.ec3")!, - finiteLength: finiteLength, - maximumBufferedBytes: 8, - sessionConfiguration: .ephemeral - ) - let session = URLSession(configuration: .ephemeral) - let task = session.dataTask(with: URL(string: "https://example.invalid/test.ec3")!) - - loader.urlSession(session, dataTask: task, didReceive: Data([1, 2, 3, 4])) - var snapshot = loader.statusSnapshot() - XCTAssertEqual(snapshot.bytesReceived, 4) - XCTAssertEqual(snapshot.retainedBytes, 4) - XCTAssertNil(snapshot.errorCode) - - loader.urlSession(session, dataTask: task, didReceive: Data([5, 6, 7, 8, 9])) - snapshot = loader.statusSnapshot() - XCTAssertEqual(snapshot.bytesReceived, 4) - XCTAssertEqual(snapshot.retainedBytes, 0) - XCTAssertEqual(snapshot.errorCode, "response_too_large") - - loader.urlSession(session, dataTask: task, didReceive: Data([10])) - let lateSnapshot = loader.statusSnapshot() - XCTAssertEqual(lateSnapshot.bytesReceived, snapshot.bytesReceived) - XCTAssertEqual(lateSnapshot.retainedBytes, 0) - loader.cancel() - loader.cancel() - XCTAssertEqual(loader.statusSnapshot().pendingRequestCount, 0) - let cancelledLoader = RawEc3Loader( - source: URL(string: "https://example.invalid/cancel.ec3")!, - finiteLength: finiteLength, - maximumBufferedBytes: 8, - sessionConfiguration: .ephemeral - ) - cancelledLoader.urlSession(session, dataTask: task, didReceive: Data([1, 2, 3, 4])) - XCTAssertEqual(cancelledLoader.statusSnapshot().retainedBytes, 4) - cancelledLoader.cancel() - cancelledLoader.cancel() - let cancelledSnapshot = cancelledLoader.statusSnapshot() - XCTAssertEqual(cancelledSnapshot.retainedBytes, 0) - XCTAssertEqual(cancelledSnapshot.pendingRequestCount, 0) - session.invalidateAndCancel() - } - } - - func testRawEc3LoaderCompletesThroughInjectedURLProtocolForBothModes() { - defer { ProbeURLProtocol.reset() } - for finiteLength in [false, true] { - let requestStarted = expectation(description: "probe request started") - let loaderFinished = expectation(description: "probe loader finished") - ProbeURLProtocol.configure { protocolInstance in - let response = URLResponse( - url: protocolInstance.request.url!, - mimeType: "audio/eac3", - expectedContentLength: -1, - textEncodingName: nil - ) - protocolInstance.client?.urlProtocol( - protocolInstance, - didReceive: response, - cacheStoragePolicy: .notAllowed - ) - protocolInstance.client?.urlProtocol(protocolInstance, didLoad: Data([1, 2, 3, 4])) - protocolInstance.client?.urlProtocolDidFinishLoading(protocolInstance) - requestStarted.fulfill() - } - - let configuration = URLSessionConfiguration.ephemeral - configuration.protocolClasses = [ProbeURLProtocol.self] - let loader = RawEc3Loader( - source: URL(string: "https://probe.test/audio.ec3")!, - finiteLength: finiteLength, - maximumBufferedBytes: 8, - sessionConfiguration: configuration, - terminalHandlerForTesting: { loaderFinished.fulfill() } - ) - loader.begin() - wait(for: [requestStarted, loaderFinished], timeout: 2) - - let snapshot = loader.statusSnapshot() - XCTAssertTrue(snapshot.isFinished) - XCTAssertEqual(snapshot.bytesReceived, 4) - XCTAssertEqual(snapshot.retainedBytes, 4) - XCTAssertNil(snapshot.errorCode) - - loader.cancel() - let cancelled = loader.statusSnapshot() - XCTAssertEqual(cancelled.retainedBytes, 0) - XCTAssertEqual(cancelled.pendingRequestCount, 0) - } - } - func testPipStartWaitsForDelegateAndCompletesOnce() { let fake = FakePictureInPictureController() fake.isPictureInPicturePossible = true