Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.17.4

* Standardizes Objective-C class names.

## 2.17.3

* Adds a README section about Swift Package Manager and the new
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
@import GoogleMaps;
@import XCTest;

#import "PartiallyMockedMapView.h"
#import "TestUtils/PartiallyMockedMapView.h"

/// A GMSCircle that ensures that property updates are made before the map is set.
@interface PropertyOrderValidatingCircle : GMSCircle {
}
@property(nonatomic) BOOL hasSetMap;
@end

@interface GoogleMapsCircleControllerTests : XCTestCase
@interface CircleControllerTests : XCTestCase
@end

@implementation GoogleMapsCircleControllerTests
@implementation CircleControllerTests

- (void)testUpdateCircleSetsVisibilityLast {
PropertyOrderValidatingCircle *circle = [[PropertyOrderValidatingCircle alloc] init];
[FLTGoogleMapCircleController
[FGMCircleController
updateCircle:circle
fromPlatformCircle:[FGMPlatformCircle
makeWithConsumeTapEvents:NO
Expand All @@ -40,7 +40,7 @@ - (void)testUpdateCircleSetsVisibilityLast {
longitude:0]
radius:10
circleId:@"circle"]
withMapView:[GoogleMapsCircleControllerTests mapView]];
withMapView:[CircleControllerTests mapView]];
XCTAssertTrue(circle.hasSetMap);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
@import GoogleMaps;
@import XCTest;

#import "PartiallyMockedMapView.h"
#import "TestAssetProvider.h"
#import "TestMapEventHandler.h"
#import "TestUtils/PartiallyMockedMapView.h"
#import "TestUtils/TestAssetProvider.h"
#import "TestUtils/TestMapEventHandler.h"

@interface FGMClusterManagersControllerTests : XCTestCase
@interface ClusterManagersControllerTests : XCTestCase
@end

@implementation FGMClusterManagersControllerTests
@implementation ClusterManagersControllerTests

- (void)testClustering {
CGRect frame = CGRectMake(0, 0, 100, 100);
Expand All @@ -29,8 +29,8 @@ - (void)testClustering {
FGMClusterManagersController *clusterManagersController =
[[FGMClusterManagersController alloc] initWithMapView:mapView eventDelegate:eventHandler];

FLTMarkersController *markersController =
[[FLTMarkersController alloc] initWithMapView:mapView
FGMMarkersController *markersController =
[[FGMMarkersController alloc] initWithMapView:mapView
eventDelegate:eventHandler
clusterManagersController:clusterManagersController
assetProvider:[[TestAssetProvider alloc] init]];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
@import GoogleMaps;
@import XCTest;

#import "PartiallyMockedMapView.h"
#import "TestUtils/PartiallyMockedMapView.h"

@interface FGMConversionUtilsTests : XCTestCase
@interface ConversionUtilsTests : XCTestCase
@end

@implementation FGMConversionUtilsTests
@implementation ConversionUtilsTests

- (void)testGetValueOrNilWithValue {
NSString *key = @"key";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@import google_maps_flutter_ios;
@import XCTest;

#import "TestAssetProvider.h"
#import "TestUtils/TestAssetProvider.h"

@interface ExtractIconFromDataTests : XCTestCase
- (UIImage *)createOnePixelImage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
@import GoogleMaps;
@import XCTest;

#import "PartiallyMockedMapView.h"
#import "TestAssetProvider.h"
#import "TestUtils/PartiallyMockedMapView.h"
#import "TestUtils/TestAssetProvider.h"

@interface MockCATransaction : NSObject <FGMCATransactionProtocol>
@property(nonatomic, assign) BOOL beginCalled;
Expand Down Expand Up @@ -50,21 +50,21 @@ - (FlutterBinaryMessengerConnection)setMessageHandlerOnChannel:(nonnull NSString

#pragma mark -

@interface FLTGoogleMapFactory (Test)
@interface FGMGoogleMapFactory (Test)
@property(strong, nonatomic, readonly) id<NSObject> sharedMapServices;
@end

@interface GoogleMapsTests : XCTestCase
@end

@interface FLTTileProviderController (Testing)
@interface FGMTileProviderController (Testing)
- (UIImage *)handleResultTile:(nullable UIImage *)tileImage;
@end

@implementation GoogleMapsTests

- (void)testPlugin {
FLTGoogleMapsPlugin *plugin = [[FLTGoogleMapsPlugin alloc] init];
FGMGoogleMapsPlugin *plugin = [[FGMGoogleMapsPlugin alloc] init];
XCTAssertNotNil(plugin);
}

Expand All @@ -74,8 +74,8 @@ - (void)testFrameObserver {
options.frame = frame;
options.camera = [[GMSCameraPosition alloc] initWithLatitude:0 longitude:0 zoom:0];
PartiallyMockedMapView *mapView = [[PartiallyMockedMapView alloc] initWithOptions:options];
FLTGoogleMapController *controller =
[[FLTGoogleMapController alloc] initWithMapView:mapView
FGMGoogleMapController *controller =
[[FGMGoogleMapController alloc] initWithMapView:mapView
viewIdentifier:0
creationParameters:[self emptyCreationParameters]
assetProvider:[[TestAssetProvider alloc] init]
Expand All @@ -94,9 +94,9 @@ - (void)testMapsServiceSync {
// The API requires a registrar, but this test doesn't actually use it, so just pass in a
// dummy object rather than set up a full mock.
id registrar = [[NSObject alloc] init];
FLTGoogleMapFactory *factory1 = [[FLTGoogleMapFactory alloc] initWithRegistrar:registrar];
FGMGoogleMapFactory *factory1 = [[FGMGoogleMapFactory alloc] initWithRegistrar:registrar];
XCTAssertNotNil(factory1.sharedMapServices);
FLTGoogleMapFactory *factory2 = [[FLTGoogleMapFactory alloc] initWithRegistrar:registrar];
FGMGoogleMapFactory *factory2 = [[FGMGoogleMapFactory alloc] initWithRegistrar:registrar];
// Test pointer equality, should be same retained singleton +[GMSServices sharedServices] object.
// Retaining the opaque object should be enough to avoid multiple internal initializations,
// but don't test the internals of the GoogleMaps API. Assume that it does what is documented.
Expand All @@ -105,7 +105,7 @@ - (void)testMapsServiceSync {
}

- (void)testHandleResultTileDownsamplesWideGamutImages {
FLTTileProviderController *controller = [[FLTTileProviderController alloc] init];
FGMTileProviderController *controller = [[FGMTileProviderController alloc] init];

NSString *imagePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"widegamut"
ofType:@"png"
Expand Down Expand Up @@ -134,8 +134,8 @@ - (void)testAnimateCameraWithUpdate {

PartiallyMockedMapView *mapView = [[PartiallyMockedMapView alloc] initWithOptions:mapViewOptions];

FLTGoogleMapController *controller =
[[FLTGoogleMapController alloc] initWithMapView:mapView
FGMGoogleMapController *controller =
[[FGMGoogleMapController alloc] initWithMapView:mapView
viewIdentifier:0
creationParameters:[self emptyCreationParameters]
assetProvider:[[TestAssetProvider alloc] init]
Expand Down Expand Up @@ -164,8 +164,8 @@ - (void)testAnimateCameraWithUpdateAndDuration {

PartiallyMockedMapView *mapView = [[PartiallyMockedMapView alloc] initWithOptions:mapViewOptions];

FLTGoogleMapController *controller =
[[FLTGoogleMapController alloc] initWithMapView:mapView
FGMGoogleMapController *controller =
[[FGMGoogleMapController alloc] initWithMapView:mapView
viewIdentifier:0
creationParameters:[self emptyCreationParameters]
assetProvider:[[TestAssetProvider alloc] init]
Expand Down Expand Up @@ -203,8 +203,8 @@ - (void)testInspectorAPICameraPosition {
PartiallyMockedMapView *mapView = [[PartiallyMockedMapView alloc] initWithOptions:mapViewOptions];

NSObject<FlutterBinaryMessenger> *binaryMessenger = [[StubBinaryMessenger alloc] init];
FLTGoogleMapController *controller =
[[FLTGoogleMapController alloc] initWithMapView:mapView
FGMGoogleMapController *controller =
[[FGMGoogleMapController alloc] initWithMapView:mapView
viewIdentifier:0
creationParameters:[self emptyCreationParameters]
assetProvider:[[TestAssetProvider alloc] init]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,23 @@
@import GoogleMaps;
@import XCTest;

#import "PartiallyMockedMapView.h"
#import "TestAssetProvider.h"
#import "TestMapEventHandler.h"
#import "TestUtils/PartiallyMockedMapView.h"
#import "TestUtils/TestAssetProvider.h"
#import "TestUtils/TestMapEventHandler.h"

/// A GMSGroundOverlay that ensures that property updates are made before the map is set.
@interface PropertyOrderValidatingGroundOverlay : GMSGroundOverlay {
}
@property(nonatomic) BOOL hasSetMap;
@end

@interface GoogleMapsGroundOverlayControllerTests : XCTestCase
@interface GroundOverlayControllerTests : XCTestCase
@end

@implementation GoogleMapsGroundOverlayControllerTests
@implementation GroundOverlayControllerTests

/// Returns GoogleMapGroundOverlayController object instantiated with position and a mocked map
/// Returns a GroundOverlayController object instantiated with position and a mocked map
/// instance.
///
/// @return An object of FLTGoogleMapGroundOverlayController
+ (FGMGroundOverlayController *)groundOverlayControllerWithPositionWithMockedMap {
NSString *imagePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"widegamut"
ofType:@"png"
Expand All @@ -35,18 +33,16 @@ + (FGMGroundOverlayController *)groundOverlayControllerWithPositionWithMockedMap
icon:wideGamutImage
zoomLevel:14.0];

GMSMapView *mapView = [GoogleMapsGroundOverlayControllerTests mapView];
GMSMapView *mapView = [GroundOverlayControllerTests mapView];

return [[FGMGroundOverlayController alloc] initWithGroundOverlay:groundOverlay
identifier:@"id_1"
mapView:mapView
isCreatedWithBounds:NO];
}

/// Returns GoogleMapGroundOverlayController object instantiated with bounds and a mocked map
/// Returns a GroundOverlayController object instantiated with bounds and a mocked map
/// instance.
///
/// @return An object of FLTGoogleMapGroundOverlayController
+ (FGMGroundOverlayController *)groundOverlayControllerWithBoundsWithMockedMap {
NSString *imagePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"widegamut"
ofType:@"png"
Expand All @@ -58,7 +54,7 @@ + (FGMGroundOverlayController *)groundOverlayControllerWithBoundsWithMockedMap {
coordinate:CLLocationCoordinate2DMake(30, 40)]
icon:wideGamutImage];

GMSMapView *mapView = [GoogleMapsGroundOverlayControllerTests mapView];
GMSMapView *mapView = [GroundOverlayControllerTests mapView];

return [[FGMGroundOverlayController alloc] initWithGroundOverlay:groundOverlay
identifier:@"id_1"
Expand All @@ -68,7 +64,7 @@ + (FGMGroundOverlayController *)groundOverlayControllerWithBoundsWithMockedMap {

- (void)testUpdatingGroundOverlayWithPosition {
FGMGroundOverlayController *groundOverlayController =
[GoogleMapsGroundOverlayControllerTests groundOverlayControllerWithPositionWithMockedMap];
[GroundOverlayControllerTests groundOverlayControllerWithPositionWithMockedMap];

FGMPlatformLatLng *position = [FGMPlatformLatLng makeWithLatitude:52.4816 longitude:3.1791];

Expand Down Expand Up @@ -120,7 +116,7 @@ - (void)testUpdatingGroundOverlayWithPosition {

- (void)testUpdatingGroundOverlayWithBounds {
FGMGroundOverlayController *groundOverlayController =
[GoogleMapsGroundOverlayControllerTests groundOverlayControllerWithBoundsWithMockedMap];
[GroundOverlayControllerTests groundOverlayControllerWithBoundsWithMockedMap];

FGMPlatformLatLngBounds *bounds = [FGMPlatformLatLngBounds
makeWithNortheast:[FGMPlatformLatLng makeWithLatitude:54.4816 longitude:5.1791]
Expand Down Expand Up @@ -205,23 +201,23 @@ - (void)testUpdateGroundOverlaySetsVisibilityLast {
visible:YES
clickable:YES
zoomLevel:nil]
withMapView:[GoogleMapsGroundOverlayControllerTests mapView]
withMapView:[GroundOverlayControllerTests mapView]
assetProvider:[[TestAssetProvider alloc] init]
screenScale:1.0
usingBounds:YES];
XCTAssertTrue(groundOverlay.hasSetMap);
}

- (void)testAssetProviderIsRetained {
FLTGroundOverlaysController *groundOverlayController;
FGMGroundOverlaysController *groundOverlayController;
__weak TestAssetProvider *weakAssetProvider;
@autoreleasepool {
TestAssetProvider *assetProvider = [[TestAssetProvider alloc] init];
weakAssetProvider = assetProvider;
groundOverlayController = [[FLTGroundOverlaysController alloc]
initWithMapView:[GoogleMapsGroundOverlayControllerTests mapView]
eventDelegate:[[TestMapEventHandler alloc] init]
assetProvider:assetProvider];
groundOverlayController =
[[FGMGroundOverlaysController alloc] initWithMapView:[GroundOverlayControllerTests mapView]
eventDelegate:[[TestMapEventHandler alloc] init]
assetProvider:assetProvider];
}
XCTAssertNotNil(groundOverlayController);
XCTAssertNotNil(weakAssetProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
@import GoogleMapsUtils;
@import XCTest;

#import "PartiallyMockedMapView.h"
#import "TestUtils/PartiallyMockedMapView.h"

@interface PropertyOrderValidatingHeatmap : GMUHeatmapTileLayer {
}
@property(nonatomic) BOOL hasSetMap;
@end

@interface GoogleMapsHeatmapControllerTests : XCTestCase
@interface HeatmapControllerTests : XCTestCase
@end

@implementation GoogleMapsHeatmapControllerTests
@implementation HeatmapControllerTests

- (void)testUpdateHeatmapSetsVisibilityLast {
PropertyOrderValidatingHeatmap *heatmap = [[PropertyOrderValidatingHeatmap alloc] init];
Expand All @@ -27,7 +27,7 @@ - (void)testUpdateHeatmapSetsVisibilityLast {
]
startPoints:@[ @(0), @(1) ]
colorMapSize:256];
[FLTGoogleMapHeatmapController
[FGMHeatmapController
updateHeatmap:heatmap
fromPlatformHeatmap:[FGMPlatformHeatmap
makeWithHeatmapId:@"heatmap"
Expand All @@ -48,7 +48,7 @@ - (void)testUpdateHeatmapSetsVisibilityLast {
radius:1
minimumZoomIntensity:1
maximumZoomIntensity:2]
withMapView:[GoogleMapsHeatmapControllerTests mapView]];
withMapView:[HeatmapControllerTests mapView]];
XCTAssertTrue(heatmap.hasSetMap);
}

Expand Down
Loading
Loading