diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2020-02-27 13:09:39 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2020-02-27 15:08:08 -0800 |
commit | f82f7a11d3db91ebf4ef5ac7330b4af168971f35 (patch) | |
tree | 0049d4d6bd9195c194c0fe96665ba72c92f00da5 /platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterSwiftTests.swift | |
parent | 6294755f323ccf00a3d152f578c3247a66051b71 (diff) | |
download | qtlocation-mapboxgl-f82f7a11d3db91ebf4ef5ac7330b4af168971f35.tar.gz |
[ios, macos] Deleted iOS/macOS map SDK sources, resources, scripts
Diffstat (limited to 'platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterSwiftTests.swift')
-rw-r--r-- | platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterSwiftTests.swift | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterSwiftTests.swift b/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterSwiftTests.swift deleted file mode 100644 index d33a986beb..0000000000 --- a/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterSwiftTests.swift +++ /dev/null @@ -1,77 +0,0 @@ -import XCTest - -class MGLMapSnapshotterSwiftTests: MGLMapViewIntegrationTest { - - // Create snapshot options - private class func snapshotterOptions(size: CGSize) -> MGLMapSnapshotOptions { - let camera = MGLMapCamera() - - let options = MGLMapSnapshotOptions(styleURL: MGLStyle.satelliteStreetsStyleURL, camera: camera, size: size) - - let sw = CLLocationCoordinate2D(latitude: 52.3, longitude: 13.0) - let ne = CLLocationCoordinate2D(latitude: 52.5, longitude: 13.2) - options.coordinateBounds = MGLCoordinateBounds(sw:sw, ne:ne) - - return options - } - - func testCapturingSnapshotterInSnapshotCompletion🔒() { - // See the Obj-C testDeallocatingSnapshotterDuringSnapshot - // This Swift test, is essentially the same except for capturing the snapshotter - - let timeout: TimeInterval = 10.0 - let expectation = self.expectation(description: "snapshot") - - let options = MGLMapSnapshotterSwiftTests.snapshotterOptions(size: mapView.bounds.size) - - let backgroundQueue = DispatchQueue.main - - backgroundQueue.async { - let dg = DispatchGroup() - dg.enter() - - DispatchQueue.main.async { - - let snapshotter = MGLMapSnapshotter(options: options) - - snapshotter.start(completionHandler: { (snapshot, error) in - -// // Without capturing snapshotter: -// XCTAssertNil(snapshot) -// XCTAssertNotNil(error) - - // Capture snapshotter - dump(snapshotter) - XCTAssertNotNil(snapshot) - XCTAssertNil(error) - - dg.leave() - }) - } - - dg.notify(queue: .main) { - expectation.fulfill() - } - } - - wait(for: [expectation], timeout: timeout) - } - - func testSnapshotOverlaySwiftErgonomics🔒() { - let options = MGLMapSnapshotterSwiftTests.snapshotterOptions(size: mapView.bounds.size) - let snapshotter = MGLMapSnapshotter(options: options) - let expectation = self.expectation(description: "snapshot") - expectation.expectedFulfillmentCount = 2 - - snapshotter.start(overlayHandler: { (overlay) in - guard let _ = overlay.context.makeImage() else { - XCTFail() - return - } - expectation.fulfill() - }) { (_, _) in - expectation.fulfill() - } - wait(for: [expectation], timeout: 10) - } -} |