Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Enable runtime styling tests on macOS #6889

Merged
merged 4 commits into from
Nov 3, 2016

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Nov 3, 2016

This PR adds a few missing header references to the macOS project and shares the runtime styling unit tests between the iOS and macOS test target. Despite the headers being missing from the project, the SDK still compiled without errors because the headers were already in the header search path. If they had been public headers, the compiler might’ve issued a warning about an incomplete umbrella header or non-module include statement. Unless we decide to go ahead with #5942, we’ll just have to remain vigilant about private headers that fly under the radar.

The runtime styling API can now round-trip colors without losing accuracy. Previously, we were using one color profile when converting NSColor to mbgl::Color and another when converting back to NSColor.

On macOS, we have to set the access token to a bogus access token before running any tests. The macOS implementation of MGLMapView doesn’t even attempt to set a default style if the access token is missing, because in macosapp, the access token may be set asynchronously by the user when the preferences window appears.

I’m targeting this PR against the release-ios-v3.4.0 branch because I intend to issue a macOS SDK release that’s as close to iOS SDK v3.4.0 as possible, and I want to ensure as much test coverage as possible.

/cc @frederoni @incanus

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS tests runtime styling labels Nov 3, 2016
@1ec5 1ec5 self-assigned this Nov 3, 2016
@mention-bot
Copy link

@1ec5, thanks for your PR! By analyzing the history of the files in this pull request, we identified @boundsj, @ituaijagbone and @frederoni to be potential reviewers.

1ec5 added 4 commits November 2, 2016 18:54
Moved MGLGeoJSONSourceTests and MGLTileSetTests into platform/darwin/test/ and added them to the macOS project. Also added a private header needed to compile the tests to the macOS project.
This header was missing from the project. The code was only compiling because the header was still on the search path.
Fixed an issue that caused the runtime styling API to return colors in the sRGB color space instead of the calibrated RGB color space.
Added the style layer tests to the test bundle target.

Set the access token to a bogus access token before running any tests. The macOS implementation of MGLMapView doesn’t even attempt to set a default style if the access token is missing, because in macosapp, the access token may be set asynchronously by the user when the preferences window appears.
@1ec5 1ec5 force-pushed the 1ec5-style-test-macos-5971 branch from 43d4a2e to a7edd0c Compare November 3, 2016 01:55
@1ec5 1ec5 merged commit 7c68d77 into release-ios-v3.4.0 Nov 3, 2016
@1ec5 1ec5 deleted the 1ec5-style-test-macos-5971 branch November 3, 2016 04:12
@1ec5
Copy link
Contributor Author

1ec5 commented Dec 6, 2016

This fixed #5971.

@1ec5 1ec5 modified the milestone: macos-v0.3.0 Jan 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants