-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into camx_90_repro
- Loading branch information
Showing
33 changed files
with
1,305 additions
and
630 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
538e7424d0180d2433534a30a5f6c34e8bca6181 | ||
fa402c8057a11481b834c478cb8374df9bbc0819 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
packages/interactive_media_ads/example/ios/RunnerTests/FriendlyObstructionTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import Flutter | ||
import GoogleInteractiveMediaAds | ||
import UIKit | ||
import XCTest | ||
|
||
@testable import interactive_media_ads | ||
|
||
class FriendlyObstructionProxyApiTests: XCTestCase { | ||
func testPigeonDefaultConstructor() { | ||
let registrar = TestProxyApiRegistrar() | ||
let api = registrar.apiDelegate.pigeonApiIMAFriendlyObstruction(registrar) | ||
|
||
let instance = try? api.pigeonDelegate.pigeonDefaultConstructor( | ||
pigeonApi: api, view: UIView(), purpose: .mediaControls, detailedReason: "myString") | ||
XCTAssertNotNil(instance) | ||
} | ||
|
||
func testPigeonDefaultConstructorWithUnknownPurpose() { | ||
let registrar = TestProxyApiRegistrar() | ||
let api = registrar.apiDelegate.pigeonApiIMAFriendlyObstruction(registrar) | ||
|
||
XCTAssertThrowsError( | ||
try api.pigeonDelegate.pigeonDefaultConstructor( | ||
pigeonApi: api, view: UIView(), purpose: .unknown, detailedReason: "myString") | ||
) { error in | ||
XCTAssertTrue(error is PigeonError) | ||
} | ||
} | ||
|
||
func testView() { | ||
let registrar = TestProxyApiRegistrar() | ||
let api = registrar.apiDelegate.pigeonApiIMAFriendlyObstruction(registrar) | ||
|
||
let instance = IMAFriendlyObstruction( | ||
view: UIView(), purpose: IMAFriendlyObstructionPurpose.closeAd, detailedReason: "reason") | ||
let value = try? api.pigeonDelegate.view(pigeonApi: api, pigeonInstance: instance) | ||
|
||
XCTAssertEqual(value, instance.view) | ||
} | ||
|
||
func testPurpose() { | ||
let registrar = TestProxyApiRegistrar() | ||
let api = registrar.apiDelegate.pigeonApiIMAFriendlyObstruction(registrar) | ||
|
||
let instance = IMAFriendlyObstruction( | ||
view: UIView(), purpose: IMAFriendlyObstructionPurpose.closeAd, detailedReason: "reason") | ||
let value = try? api.pigeonDelegate.purpose(pigeonApi: api, pigeonInstance: instance) | ||
|
||
XCTAssertEqual(value, FriendlyObstructionPurpose.closeAd) | ||
} | ||
|
||
func testDetailedReason() { | ||
let registrar = TestProxyApiRegistrar() | ||
let api = registrar.apiDelegate.pigeonApiIMAFriendlyObstruction(registrar) | ||
|
||
let instance = IMAFriendlyObstruction( | ||
view: UIView(), purpose: IMAFriendlyObstructionPurpose.closeAd, detailedReason: "reason") | ||
let value = try? api.pigeonDelegate.detailedReason(pigeonApi: api, pigeonInstance: instance) | ||
|
||
XCTAssertEqual(value, instance.detailedReason) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
.../interactive_media_ads/Sources/interactive_media_ads/FriendlyObstructionAPIDelegate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import Foundation | ||
import GoogleInteractiveMediaAds | ||
import UIKit | ||
|
||
/// ProxyApi implementation for [IMAFriendlyObstruction]. | ||
/// | ||
/// This class may handle instantiating native object instances that are attached to a Dart instance | ||
/// or handle method calls on the associated native class or an instance of that class. | ||
class FriendlyObstructionProxyAPIDelegate: PigeonApiDelegateIMAFriendlyObstruction { | ||
func pigeonDefaultConstructor( | ||
pigeonApi: PigeonApiIMAFriendlyObstruction, view: UIView, purpose: FriendlyObstructionPurpose, | ||
detailedReason: String? | ||
) throws -> IMAFriendlyObstruction { | ||
var nativePurpose: IMAFriendlyObstructionPurpose | ||
switch purpose { | ||
case .mediaControls: | ||
nativePurpose = IMAFriendlyObstructionPurpose.mediaControls | ||
case .closeAd: | ||
nativePurpose = IMAFriendlyObstructionPurpose.closeAd | ||
case .notVisible: | ||
nativePurpose = IMAFriendlyObstructionPurpose.notVisible | ||
case .other: | ||
nativePurpose = IMAFriendlyObstructionPurpose.other | ||
case .unknown: | ||
throw (pigeonApi.pigeonRegistrar.apiDelegate as! ProxyApiDelegate).createUnknownEnumError( | ||
withEnum: purpose) | ||
} | ||
return IMAFriendlyObstruction( | ||
view: view, purpose: nativePurpose, detailedReason: detailedReason) | ||
} | ||
|
||
func view(pigeonApi: PigeonApiIMAFriendlyObstruction, pigeonInstance: IMAFriendlyObstruction) | ||
throws -> UIView | ||
{ | ||
return pigeonInstance.view | ||
} | ||
|
||
func purpose(pigeonApi: PigeonApiIMAFriendlyObstruction, pigeonInstance: IMAFriendlyObstruction) | ||
throws -> FriendlyObstructionPurpose | ||
{ | ||
switch pigeonInstance.purpose { | ||
case .mediaControls: | ||
return .mediaControls | ||
case .closeAd: | ||
return .closeAd | ||
case .notVisible: | ||
return .notVisible | ||
case .other: | ||
return .other | ||
@unknown default: | ||
return .unknown | ||
} | ||
} | ||
|
||
func detailedReason( | ||
pigeonApi: PigeonApiIMAFriendlyObstruction, pigeonInstance: IMAFriendlyObstruction | ||
) throws -> String? { | ||
return pigeonInstance.detailedReason | ||
} | ||
} |
Oops, something went wrong.