Граф коммитов

162 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 0863e412b4 Remove XI/Classic support (#926)
* [tests] Remove Classic SDK tests.

* Remove XI/Classic support.

This also means we can remove support for the legacy registrars.

* [monotouch-test] Remove legacy registrar tests.

* [tests/mtouch] Remove Classic tests (and legacy registrar logic).

* [tests/scripted] Fix tests to reference Xamarin.iOS.dll.
2016-09-30 15:02:17 -04:00
Sebastien Pouliot d0773a9ffc [avfoundation] Add overloads to AVCaptureDevice that accept an enum. Fixes #32535 (#922)
The current API use `string`, not `NSString` is added as a step forward.
The `NSString` is more correct but it does not ease discoverability (e.g.
code completion) so an enum-based overload is added (as the preferred API).

https://bugzilla.xamarin.com/show_bug.cgi?id=32535
2016-09-30 12:49:45 -04:00
Alex Soto b8bd71c7b5 [Security] Add convenience Certificate, Key and Identity ctors to SecRecord (#905) 2016-09-28 08:17:39 -04:00
Alex Soto 5c10b87637 [CoreImage] Add missing property ColorSpace to CIImage (#906)
https://bugzilla.xamarin.com/show_bug.cgi?id=44438

The ColorSpace property is decorated with the CF_RETURNS_NOT_RETAINED
macro, this means it returns an object that follows the CoreFoundation
[Ownership Policy](1) but it does not follow the naming convention
documented in the policy.

The [CF_RETURNS_NOT_RETAINED](2) indicates that the object reference
returned is not owned by the caller, so we should definitely call
CGColorSpaceRetain when obtaining a handle.

Since CGColorSpace is considered into the [MarshalType list](3) the
generated code ends up calling the IntPtr ctor which does the right
thing, [calling CGColorSpaceRetain](4) in the given ptr.

And last but not least, we already bind another property decorated
with [CF_RETURNS_NOT_RETAINED](2) in [CIColor::ColorSpace](5).

[1]: https://developer.apple.com/library/content/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html
[2]: http://clang-analyzer.llvm.org/annotations.html#attr_cf_returns_not_retained
[3]: 0bc23b379a/src/generator.cs (L2642)
[4]: https://github.com/xamarin/xamarin-macios/blob/xcode8/src/CoreGraphics/CGColorSpace.cs#L77-L80
[5]: https://github.com/xamarin/xamarin-macios/blob/xcode8/src/coreimage.cs#L112-L113
2016-09-28 12:33:51 +02:00
Alex Soto 72f6d0a232 [Foundation] NSUrlSession's Create*Task methods may return a base class of the type the headers claim. Fixes #37175.
https://bugzilla.xamarin.com/show_bug.cgi?id=37175

NSUrlSession's Create*Task methods may return an object of the wrong
type (NSUrlSessionTask instead of NSUrl[Data|Download|Upload]SessionTask),
so we need to bypass our type check when creating the managed object,
otherwise we end up throwing InvalidCastExceptions randomly. We will
return the type that is declared on the headers so if the native side
returns a cat and headers says it barks we'll we make it bark :).
2016-09-23 21:37:33 -05:00
Alex Soto 7845caa577 [AVFoundaation] Fix bug 44322 - AVAssetDownloadUrlSession.CreateSession throws a System.InvalidCastException: Specified cast is not valid.
https://bugzilla.xamarin.com/show_bug.cgi?id=44322

AVAssetDownloadUrlSession.CreateSession according to headers it
should return an AVAssetDownloadUrlSession but it is returning
an apple internal type NSURLBackgroundSession so with our
current bindings it throws an InvalidCastException, adding
ForcedTypeAttribute will create the managed type wihout
the actual typecheck. Added test verifing that the API
no longer throws.
2016-09-23 19:17:57 -05:00
Rolf Bjarne Kvinge 9000e48034 [tests] Remove Classic test projects, and make the Unified test projects the master projects. (#858) 2016-09-21 22:55:10 +02:00
Rolf Bjarne Kvinge a4920078ff [registrar] Look up the right type when getting the constrained type for a generic type. Fixes #44309. (#848)
https://bugzilla.xamarin.com/show_bug.cgi?id=44309
2016-09-21 08:36:34 -05:00
Rolf Bjarne Kvinge eb373635bd [registrar] Look up the right type when getting the constrained type for a generic type. Fixes #44309. (#848)
https://bugzilla.xamarin.com/show_bug.cgi?id=44309
2016-09-19 14:26:30 -04:00
Manuel de la Pena 85b519311a [CoreMedia] ClockOrTimebase should retain the pointer in the constructor that takes a handle. (#821)
This change fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=44154
2016-09-14 08:09:52 -04:00
Sebastien Pouliot eac032a0d6 [modelio] Add missing availability attributes on new API. Fixes #44192 (#831)
and ignore them when running tests on older devices, e.g. iOS 9.3.x

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=44192
2016-09-13 20:32:27 -04:00
Sebastien Pouliot 38148c718a Merge branch 'xcode8' 2016-09-09 15:29:37 -04:00
Vincent Dondain 9a7f86d81a [healthkit] Update for iOS 10 GM (#800) 2016-09-07 18:19:19 -04:00
Sebastien Pouliot 5db30f619e [metal] Fix MTLHeapDescriptor and test it only on devices (#782)
It turns out `MTLHeapDescriptor` does not exists on the simulator.

```Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_MTLHeapDescriptor", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64```

A `[DisableDefaultCtor]` was used (by mistake / lack of documentation)
and this was hiding the issue (on our bots).

However on device introspection was not happy:

iOSApiSelectorTest
[FAIL] Selector not found for Metal.MTLHeapDescriptor : cpuCacheMode
[FAIL] Selector not found for Metal.MTLHeapDescriptor : setCpuCacheMode:
[FAIL] Selector not found for Metal.MTLHeapDescriptor : size
[FAIL] Selector not found for Metal.MTLHeapDescriptor : setSize:
[FAIL] Selector not found for Metal.MTLHeapDescriptor : storageMode
[FAIL] Selector not found for Metal.MTLHeapDescriptor : setStorageMode:
    [FAIL] iOSApiSelectorTest.ApiSelectorTest.InstanceMethods :   6 errors found in 18339 instance selector validated

Note that these are the properties, not the `init` that's mentioned here.

So first `init` is possible, on devices, from Xcode:

	MTLHeapDescriptor *hd = [[MTLHeapDescriptor alloc] init];
	NSLog (@"%@", [hd description]);

gives

	<MTLHeapDescriptorInternal: 0x17401da50>
	{
		cpuCacheMode = MTLCPUCacheModeDefaultCache;
		size = 0;
		storageMode = MTLStorageModePrivate;
		}

so we need to remove our `[DisableDefaultCtor]`.

That does not fix the selectors above... but note the *Internal type
returned, they are forwarded and that's generally something that
respondToSelector (that introspection uses) does not cover.

But, to be sure, we add unit tests showing all the properties are
working like expected :-)
2016-09-07 08:03:14 -04:00
Sebastien Pouliot f5052c105c [healthkit] Change binding for HKDetailedCdaErrors (#757)
* [healthkit] Change binding for HKDetailedCdaErrors

* Hide [Fields]
* Easier access to the information from NSError
* Unit test (mostly to make sure of the returned type)

* [healthkit] Remove HKDetailedCDAValidationErrorKey from watchOS profile

It's used from an NSError returned from an API that is not available in
watchOS.
2016-09-03 11:36:05 -04:00
Sebastien Pouliot 4c09e91f91 [watchos] Remove several [Obsolete] API when alternatives exists (#742) 2016-09-02 10:02:29 -04:00
Sebastien Pouliot 4220714485 Merge branch 'cycle8' into xcode8 2016-09-01 14:38:23 -04:00
Sebastien Pouliot 3428fdc400 [tests] Update monotouch-test to add version checks when executing on older iOS versions. Fixes #43920 (#729)
Tested with iOS 9.3, 8.4 and 6.1.

https://bugzilla.xamarin.com/show_bug.cgi?id=43920
2016-08-31 23:08:54 -04:00
Sebastien Pouliot d9c309b85d [modelio] Fix several incorrect (headers) availability on new API (only in iOS10, not 9) (#726) 2016-08-31 17:59:53 -04:00
Alex Soto b8a2ced04b [Midi] Fix bug 43582 - MidiEndpoint throws, bad dispose of GCHandle
https://bugzilla.xamarin.com/show_bug.cgi?id=43582

- Thanks to @olegoid for the actual investigation and fix
- Added test that verifies the fix
2016-08-31 08:48:11 -04:00
Rolf Bjarne Kvinge 7de44f3253 [tests] Fix a couple of registrar tests to work on device. (#719)
Fixes the following test failures:

    [FAIL] BlockSignatureTest.WithoutUserDelegateTypeAttribute : System.ExecutionEngineException : Attempting to JIT compile method '(wrapper native-to-managed) MonoTouchFixtures.ObjCRuntime.BlockSignatureTest:<WithoutUserDelegateTypeAttribute>m__0 (intptr,intptr)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.
    	  at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:GetFunctionPointerForDelegateInternal (System.Delegate)
    	  at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate (System.Delegate d) [0x00011] in /work/maccore/xcode8/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs:1714
    	  at ObjCRuntime.BlockLiteral.SetupBlock (System.Delegate trampoline, System.Delegate userDelegate) [0x0000b] in /work/maccore/xcode8/xamarin-macios/src/ObjCRuntime/Blocks.cs:92
    	  at MonoTouchFixtures.ObjCRuntime.BlockSignatureTest.WithoutUserDelegateTypeAttribute () [0x00049] in /work/maccore/xcode8/xamarin-macios/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs:2585
    	  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    	  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /work/maccore/xcode8/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:309

    [FAIL] BlockSignatureTest.WithUserDelegateTypeAttribute : System.ExecutionEngineException : Attempting to JIT compile method '(wrapper native-to-managed) MonoTouchFixtures.ObjCRuntime.BlockSignatureTest:<WithUserDelegateTypeAttribute>m__2 (intptr,intptr)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.
    	  at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:GetFunctionPointerForDelegateInternal (System.Delegate)
    	  at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate (System.Delegate d) [0x00011] in /work/maccore/xcode8/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs:1714
    	  at ObjCRuntime.BlockLiteral.SetupBlock (System.Delegate trampoline, System.Delegate userDelegate) [0x0000b] in /work/maccore/xcode8/xamarin-macios/src/ObjCRuntime/Blocks.cs:92
    	  at MonoTouchFixtures.ObjCRuntime.BlockSignatureTest.WithUserDelegateTypeAttribute () [0x00049] in /work/maccore/xcode8/xamarin-macios/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs:2596
    	  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    	  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /work/maccore/xcode8/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:309
2016-08-31 13:54:47 +02:00
Alex Soto 83cfa197a9 [Midi] Fix bug 43582 - MidiEndpoint throws, bad dispose of GCHandle
https://bugzilla.xamarin.com/show_bug.cgi?id=43582

- Thanks to @olegoid for the actual investigation and fix
- Added test that verifies the fix
2016-08-31 01:48:28 -05:00
Sebastien Pouliot a2899b842c [cloudkit] Fix some missing .ctor (breaking changes) (#711)
Enabling CloudKit on watchOS required to remove some default .ctor that
watchOS does not _support_.

This commit fix this by either

* replacing the default .ctor with something that works across all
  platforms (best); or

* removing the default .ctor only on watchOS;

The commit also mark as abstract three existing types for watchOS (and
for XAMCORE_4_0) that were found reviewing the bindings.
2016-08-30 19:14:48 -04:00
Alex Soto 209f4f3709 [GameplayKit] Update from Xcode8 Beta 1 to Beta 6 (#689)
Runtime
- Added support for Vector2d, Vector3d and Vector4d SIMD types
- Added support for GKBox, GKQuad and GKTriangle SIMD types

GameplayKit
- Apple introduced GKQuadTreeNode and GKQuadTree in Xcode 7.1 and
  removed those types in a later Xcode (7.2?) but we kept them around.
  Now apple introduced again both types but renamed them to GKQuadtreeNode
  and GKQuadtree (lowercase t), this is a breaking change and since we do
  care about binary compat we are just changing the registration name and
  keeping the same managed name deprecating old methods and introducing
  the new ones.
- Added tests for new SIMD types
2016-08-30 15:32:46 -04:00
Sebastien Pouliot f74a7a7911 [messageui] Review (and add test) the enum breaking change from Apple. Fixes #42682 (#710)
Xcode8 SDK changed untyped enums (always 32 bits) into NSInteger. In this
case we can continue with the existing API (and ignore them in xtro)

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=42682
2016-08-30 14:26:49 -04:00
Manuel de la Pena d5bb9326ec [Metal] Update bindings for Xcode 8. (#663) 2016-08-29 08:21:06 -04:00
Sebastien Pouliot afd50b2bef [watchos][avfoundation] Enable AVFoundation in watchOS (#659) 2016-08-25 11:39:48 -04:00
Rolf Bjarne Kvinge d99d8c8cbe Fix ObjC encoding of block signatures. Fixes #43592. (#662)
The P/Invoke callback method that's called by native code
has a simpler function signature than what the user delegate
has.

Example P/Invoke callback signature:

    static unsafe void Invoke (IntPtr block, IntPtr obj)

which ends up calling this delegate:

    System.Action<NSDictionary>

The NSDictionary parameter has been simplifed to just IntPtr.

The problem is that we need to encode the block signature according
to the signature of the user delegate (Apple uses the signature
in some cases, and fails/aborts if the signature doesn't match
what the code expects).

So add more metadata to make it possible to find the signature
of the user delegate at runtime.

The generator generates code like this:

    block_scheduledCompletion.SetupBlock (Trampolines.SDActionArity1V2.Handler, scheduledCompletion);

where SDActionArity1V2.Handler is defined as this:

    static internal readonly DActionArity1V2 Handler = Invoke;

this means we can get the type of `Trampolines.SDActionArity1V2.Handler` at runtime
(which would be `DActionArity1V2` in this case), so put a new attribute (`UserDelegateTypeAttribute`)
at that type:

    [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
    [UserDelegateType (typeof (global::System.Action<NSDictionary>))]
    internal delegate void DActionArity1V2 (IntPtr block, IntPtr obj);

Then at runtime we check if the target delegate's type has this attribute,
and then we use the type specified by this new attribute instead when
computing the ObjC signature of the block.

https://bugzilla.xamarin.com/show_bug.cgi?id=43592
2016-08-25 11:08:22 -04:00
Alex Soto 9354e2044e [Intents] Fixes bug 43205 - SiriKit API Inconsistencies
https://bugzilla.xamarin.com/show_bug.cgi?id=43205

Per documentation[1] INIntentResolutionResult is an abstract class
and now we honor that, also we now provide the right return type
on each of the properties (NeedsValue, NotRequired and Unsupported)
in all subclasses of INIntentResolutionResult.

Unit tests added for all INIntentResolutionResult subclasses.

[1]: https://developer.apple.com/reference/intents/inintentresolutionresult?language=objc
2016-08-24 10:14:27 -05:00
Sebastien Pouliot eb8d0be0a4 [security] Add new API (up to beta 6) and unit tests (#646)
A problem, that exists with the current API, is that several constants
are hidden but many are needed in some dictionaries - and not all of
them can be turned into _classic_ StrongDictionary.

This initial PR does not solve all the (old) problems, but it does offer
some useful overloads that makes the API usable for basic usages and
expose the NSDictionary-based API.
2016-08-23 11:36:39 -04:00
Sebastien Pouliot f63ecd7a21 [uikit] Re-expose 'defaultFormat' in UIGraphicsRendererFormat subclasses since it returns a 'instancetype'. Fixes #43640 (#643)
https://bugzilla.xamarin.com/show_bug.cgi?id=43640
2016-08-23 10:53:57 -04:00
Sebastien Pouliot 4f53b7e51f [tests] Fix NetworkReachabilityTest/Loopback difference on iOS/tvOS 10+. Fixes 42542 (#638)
https://bugzilla.xamarin.com/show_bug.cgi?id=42542
2016-08-22 11:03:26 -04:00
Vincent Dondain 5999d9cc4e [modelio] Update for iOS 10 beta 1 (#606) 2016-08-19 13:55:59 -04:00
Sebastien Pouliot b611414ef0 [tests] Add NSCameraUsageDescription to monotouch-test to avoid crash in AVFoundation. Fixes bug #43517 (#634) 2016-08-19 11:18:58 -04:00
Sebastien Pouliot c7abd28f2c [foundation] Fix NSDimension.BaseUnit on subclasses. Fixes #43444 (#623)
This is a static selector that needs to be overridden, which is not the
usual pattern in C#. We re-define it using [New] on subclasses.

Unit tests added for all NSDimension subclasses.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=43444
2016-08-19 08:27:23 -05:00
Sebastien Pouliot a0fd00c083 [tests] Fix monotouch-test failures when executed on iOS 9.x. Fixes bug #43520 (#632) 2016-08-18 22:59:26 -04:00
Manuel de la Pena a5f6564aaa [AVFoundation] Update bindings for Xcode 8. (#598)
[AVFoundation] Update bindings for Xcode 8.
2016-08-18 13:17:17 +02:00
Sebastien Pouliot f2f4bc8ccf [tests] Add NSMicrophoneUsageDescription to monotouch-test. Fixes #42544 (#604)
New requirement for iOS10 on devices

https://bugzilla.xamarin.com/show_bug.cgi?id=42544
2016-08-13 13:04:08 -04:00
Sebastien Pouliot c9633e3515 [coregraphics] Update up to beta 5 (#599)
Apple removed CGColorConverter even if it was publicly exposed in iOS 9.3,
not that I recall any API that consumed it...

It was replaced by a new, very close, type named CGColorConversionInfo and
the existing code and tests were updated to the new API.

So for `CGColorConverter` we're

* iOS: Obsoleted + code removal
* tvOS: Obsoleted + code removal
* watchOS: the API can be removed as it was not exposed in a stable release
* macOS: it was not enabled (did not work)

* [tests] Adjust ApiCMAttachmentTest so it knows how to create the new CGColorConversionInfo type
2016-08-12 13:45:09 +02:00
Manuel de la Pena 65ffc88aa5 [AVFoundation] Update bindings for XCode8. Focus on enums and structs. (#591) 2016-08-11 08:22:59 -04:00
Vincent Dondain c932422e9e [healthkit] Update for iOS 10 beta 1 (#572) 2016-08-09 10:23:12 -04:00
Manuel de la Pena 97bcc9fd0a [CloudKit] Update bindings for Xcode 8. (#530) 2016-08-09 08:11:44 -04:00
Vincent Dondain ddd1988f64 [spritekit] Update for iOS 10 beta 1 (#498)
* [spritekit] Update for iOS 10 beta 1

* [spritekit] Add missing MarshalDirective

* [runtime] Add missing simd function signatures

- Add matrix_float2x2 and matrix_float3x3 natives types.

* [introspection] Fix ApiSignatureTest

- We now avoid checking {?=[X]} encoded signatures.
- We now calculate the right size for matrix_float2x2, matrix_float3x3 and matrix_float4x4.
- Fix SKWarpGeometryGrid wrong bindings revealed by tests (IntPtr instead of Vector2).

* [monotouch-test] Add SKUniform and SKWarpGeometryGrid tests
2016-08-03 19:12:07 +02:00
Sebastien Pouliot 3f0d43debf [foundation] Adding new iOS 10 API (part 1) (#503)
- Split in two to ease review;

- Unit tests added for NSUrlSessionTaskMetrics and
  NSUrlSessionTaskTransactionMetrics as they don't respond to selectors
  like expected (but just like other NSUrlSession* types)
2016-08-02 08:03:35 -04:00
Rolf Bjarne Kvinge 90f56133f9 [monotouch-test] Tweak UrlSessionTest.DownloadDataAsync to not crash the process if exceptions occur. (#466) 2016-07-22 17:11:45 -04:00
Sebastien Pouliot 7637658e28 Merge branch 'cycle8' into xcode8 2016-07-21 11:40:41 -04:00
Sebastien Pouliot 72d0658344 [security][tvos] Remove SecSharedCredential API (#457)
Xcode8 SDK (for tvOS 10) marked those API with __TVOS_UNAVAILABLE making
them only available on iOS.

Since the API are not yet released in stable (C8) so we can removing
them  proactively. It will be easier to add them back later (if the
situation change) than removing/obsoleting them.
2016-07-21 11:37:28 -04:00
Sebastien Pouliot 413b5c2a88 [security][tvos] Remove SecSharedCredential API (#457)
Xcode8 SDK (for tvOS 10) marked those API with __TVOS_UNAVAILABLE making
them only available on iOS.

Since the API are not yet released in stable (C8) so we can removing
them  proactively. It will be easier to add them back later (if the
situation change) than removing/obsoleting them.
2016-07-21 11:30:19 -04:00
Sebastien Pouliot 31aa2959cd [tests][monotouch-tests] Skip UrlSessionTest.CreateDataTaskAsync as all cases fails on watchOS 3 beta 3 (#449) 2016-07-20 13:44:51 -04:00
Sebastien Pouliot 5fd99350df [tests] Fix MoviePlayerControllerTest for it's classic only test (broke on iOS 10 beta 3) (#443) 2016-07-20 08:15:09 -04:00
Vincent Dondain c87be8b279 [mediaplayer] Update for iOS 10 beta 3 (#446) 2016-07-20 08:14:50 -04:00
Sebastien Pouliot 980e71bc10 Bump Xcode requirement to 8.0 beta 3 (#418) 2016-07-18 23:16:44 -04:00
Sebastien Pouliot 52ffb2b251 Merge branch 'cycle8' into xcode8 2016-07-18 14:34:12 -04:00
Sebastien Pouliot 24b5dfbcb9 [tests] Disable PassLibraryTest.Default on watchOS as it hangs the process (#412)
Jul 15 15:44:26 castor monotouchtest[42732]: [default] [ERROR] error while getting ubiquityIdentityToken: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.bird.token was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.bird.token was invalidated.}

^ the above is printed several times after this
2016-07-18 08:35:53 -04:00
Sebastien Pouliot f38d545d31 [tests] Ensure monotouch-test runs fine down to iOS 6.1 (#411)
* Mostly missing checks

* FontTest: Apple never fixed that and the way we link now, without
  dlsym, makes the test crash

dyld: lazy symbol binding failed: Symbol not found: _CTFontCreateWithFontDescriptorAndOptions
  Referenced from: /var/mobile/Applications/6025D222-F50E-46E0-8BF5-9C45D4C7DACB/monotouchtest.app/monotouchtest
  Expected in: /System/Library/Frameworks/CoreText.framework/CoreText
2016-07-15 18:10:30 -04:00
Vincent Dondain 2dfe8fe400 [mediaplayer] Update for iOS 10 beta 1 - Part 2 (#406) 2016-07-15 13:19:25 -04:00
Sebastien Pouliot d2c1b63ec0 Fix monotouch-tests failures on older iOS versions (#401)
Tested with iOS 7.1 on an iPad 3

- Dynamic registrar needs to ignore new CBManager base class;
- CGImageMetadataTag.Value returns a mutable array on iOS10;
- MPMediaItem properties needed 9.2 / 10.0 check;
- MSMessage not available before Xcode 8;
- Metal not available before Xcode 6;
- MetalPerformanceShaders not available before Xcode 7;
2016-07-14 22:00:52 -04:00
Rolf Bjarne Kvinge 63811c85e5 [registrar] Use the correct parameters when generating category methods. Fixes #42489. (#385)
Category methods are exposed like extension methods, and the first parameter
specifies the class, which means we need to skip the first type when generating
the ObjC signature.

https://bugzilla.xamarin.com/show_bug.cgi?id=42489
2016-07-14 15:33:21 -04:00
Rolf Bjarne Kvinge 724308cb0d [registrar] Forward-declare ObjC classes. Fixes #42454. (#395)
There can be circular dependencies between Objective-C classes,
so make sure we don't fail compilation when that occurs by
forward declaring any Objective-C classes/protocols.

The test case in question does not contain a circular dependency,
but the same issue occurs due to types not being generated in the
correct order (a correct order could be constructed for the test
case, but there's no general solution since circular dependencies
can exist).

https://bugzilla.xamarin.com/show_bug.cgi?id=42454
2016-07-14 15:28:57 -04:00
Rolf Bjarne Kvinge ddfad1bc88 [registrar] Use the correct parameters when generating category methods. Fixes #42489. (#396)
Category methods are exposed like extension methods, and the first parameter
specifies the class, which means we need to skip the first type when generating
the ObjC signature.

https://bugzilla.xamarin.com/show_bug.cgi?id=42489
2016-07-14 18:42:30 +02:00
Rolf Bjarne Kvinge e6fc5a15d0 [runtime] Parse unions in objc encodings correctly. Fixes #42452. (#394)
Unions are defined as follows:

    (name=type...)

and we were not correctly parsing the 'name=' part.

https://bugzilla.xamarin.com/show_bug.cgi?id=42452
2016-07-14 18:03:02 +02:00
Vincent Dondain 23386a9217 [mediaplayer] Update for iOS 10 beta 1 - Part 1 (#386)
- Includes tests.
- Add availability flags.
- Turn new fields into properties.
- Verify bindings on iOS 9.3.
- Added protection in MPNowPlayingInfoCenter if native fields
  are not available (depending on the iOS version).
2016-07-14 08:45:30 -04:00
Sebastien Pouliot f085b17b36 [tests] Add missing version check on AUViewController tests. Fixes #42440 (#393)
Type was introduced in iOS 9, so it fails on earlier versions.

https://bugzilla.xamarin.com/show_bug.cgi?id=42440
2016-07-13 23:10:35 -04:00
Sebastien Pouliot b4ac7238b8 [tests] Add missing version check on AUViewController tests. Fixes #42440 (#393)
Type was introduced in iOS 9, so it fails on earlier versions.

https://bugzilla.xamarin.com/show_bug.cgi?id=42440
2016-07-13 23:04:18 -04:00
Sebastien Pouliot cf27c2e7a8 Merge branch 'cycle8' into xcode8 2016-07-13 16:43:00 -04:00
Vincent Dondain dd79e15f3b [monotouch-test] Fix permissions in Info.plist (#388) 2016-07-12 20:34:49 -04:00
Rolf Bjarne Kvinge a7a0bb4f05 [registrar] Forward-declare ObjC classes. Fixes #42454. (#387)
There can be circular dependencies between Objective-C classes,
so make sure we don't fail compilation when that occurs by
forward declaring any Objective-C classes/protocols.

The test case in question does not contain a circular dependency,
but the same issue occurs due to types not being generated in the
correct order (a correct order could be constructed for the test
case, but there's no general solution since circular dependencies
can exist).

https://bugzilla.xamarin.com/show_bug.cgi?id=42454
2016-07-12 20:34:18 -04:00
Rolf Bjarne Kvinge 249cf2f402 [runtime] Parse unions in objc encodings correctly. Fixes #42452. (#382)
Unions are defined as follows:

    (name=type...)

and we were not correctly parsing the 'name=' part.

https://bugzilla.xamarin.com/show_bug.cgi?id=42452
2016-07-12 20:19:06 -04:00
Sebastien Pouliot 7c6181dc66 [tests] Fix UIColor unit tests (in classic only) (#366)
Does not affect the Jenkins bots (which don't run classic tests) but
fails on wrench (who still runs them right now). There's a difference
in how equality is checked between classic and unified and that expose
a, not really important, change in iOS10.
2016-07-08 16:54:24 -04:00
Sebastien Pouliot afb3ea1e3f Bump Xcode version to beta 2 (#349)
Fix issues with monotouch-tests with beta2

* TLSMaximumSupportedProtocol returns Unknown, which also means default,
  instead of SslProtocol.Tls_1_2

* Setting NSZone.Name crash the app

* The MDLMesh tests are broken in a different way than beta1

* [callkit] Disable CTCallCenter default ctor as it breaks introspection

> [FAIL] Default constructor not allowed for CoreTelephony.CTCallCenter : SIGILL

The exception, that we catch, puts the process in an unstable state.

This cause weird results and crash later (wrong dispatch queue on main
thread) when testing MapKit.

Crashed Thread:        0  tid_a07  Dispatch queue: CTCallCenter

Exception Type:        EXC_BAD_ACCESS (SIGABRT)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000004
Exception Note:        EXC_CORPSE_NOTIFY

VM Regions Near 0x4:
-->
    __TEXT                 0000000000097000-00000000004d2000 [ 4332K] r-x/rwx SM=COW  /Users/USER/Library/Developer/CoreSimulator/Devices/9446B344-62A2-42A8-A8EE-9FE7AC6BA5C8/data/Containers/Bundle/Application/81183608-DADF-4226-B7FE-4B43759D679A/introspection.app/introspection

Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: dispatch_barrier_sync called on queue already owned by current thread
abort() called
CoreSimulator 278 - Device: iPhone 5 - Runtime: iOS 10.0 (14A5297c) - DeviceType: iPhone 5

Some beta2 adjustments (removals) to get green tests and be able to merge it so bindings of beta2 can start

* [tests] NEFlowMetaData conformance to NSSecureCoding and NSCopying is new in beta2 (and check fails on OSX 10.11)

* [uikit] Add [UIScrollView|UITableViewController].refreshControl to fix monotouch-test build

UIRefreshControlHosting was removed in beta2 but we still need the
refreshControl property on UIScrollView and UITableViewController
to build monotouch-test
2016-07-07 13:10:24 -04:00
Vincent Dondain c8c27a01b2 [coretext] Update for iOS 10 beta1 (#346) 2016-07-05 16:49:59 -04:00
Sebastien Pouliot 5388f5d02f [coregraphics] Added new CGColorSpace API from iOS 10 beta 1 (#337)
Also updated unit tests.
2016-07-04 21:57:30 -04:00
Alex Soto 42b6cf57f1 [DictionaryContainer] Add support for CGRect/CGPoint/CGSize and CMTime
* Added support in DictionaryContainer for CGRect/CGPoint/CGSize and CMTime
* Added support for [StrongDictionary] using CGRect/CGPoint/CGSize and CMTime
* Added tests using DictionaryContainers for CGRect/CGPoint/CGSize and CMTime
2016-07-03 11:11:06 -05:00
Rolf Bjarne Kvinge 81a8e7aee7 [Foundation] NSUbiquitousKeyValueStore is not available on watchOS. (#333)
* [Foundation] NSUbiquitousKeyValueStore is not available on watchOS.

Fixes an issue found by the introspection tests when running on a
watchOS device.

* [monotouch-test] Fix watchOS build with regards to NSUbiquitousKeyValueStore changes.
2016-06-30 03:47:13 -07:00
Sebastien Pouliot 8b5a06df3d [coregraphics] Re-enable CGColorConverterCreateSimple API and tests (#325)
This was added in iOS 9.3 SDK but only worked on the simulator as the
calls were not present on the device libraries.

This is fixed in iOS 10 beta 1.

https://trello.com/c/Rwko9Wef/37-24734681-cgcolorconvertercreatesimple-is-missing-for-device-builds
2016-06-29 20:03:06 -04:00
Rolf Bjarne Kvinge 1bc24751d0 [monotouch-test] Fix watchOS build. (#317) 2016-06-29 06:28:30 -07:00
Rolf Bjarne Kvinge 7e773080a9 Merge remote-tracking branch 'origin/master' into xcode8 2016-06-29 10:23:03 +02:00
Rolf Bjarne Kvinge 464aab3789 [monotouch-test] Fix ContactStoreTest.GetUnifiedContacts to not completely ignore the second half of the test. (#307) 2016-06-28 15:04:36 -07:00
Rolf Bjarne Kvinge 5b3fcd002f [monotouch-test] Fix ContactStoreTest for watchOS. (#306) 2016-06-28 15:00:53 -07:00
Sebastien Pouliot e3ac382fc7 [corevideo] Small update for iOS 10 beta 1 (#280)
* [corevideo] Small update for iOS 10 beta 1

and tests for 4CC to enums conversion
2016-06-28 16:25:24 -04:00
Rolf Bjarne Kvinge d3b8de52d6 [monotouch-test] Try to fix UrlSessionTest.CreateDataTaskAsync by uploading using POST. (#304)
Also use https instead of http to avoid a network roundtrip
(since http://www.xamarin.com just redirects to https).

This will hopefully fix this random test failure:

    [FAIL] UrlSessionTest.CreateDataTaskAsync : CreateUploadTask a
2016-06-28 13:33:59 -04:00
Rolf Bjarne Kvinge 67cf4c1ccd [monotouch-test] Update ModelIO tests to use Xcode versioning. 2016-06-28 16:34:10 +02:00
Rolf Bjarne Kvinge 1a1958f52d Merge remote-tracking branch 'origin/master' into xcode8 2016-06-28 12:44:08 +02:00
Alex Soto 2b51bf257b [NS(mutable)Dictionary] Fix bug 41343 - NSDictionary<TKey, TValue>.FromObjectsAndKeys keys and values are twisted up (#281)
https://bugzilla.xamarin.com/show_bug.cgi?id=41343

* NSDictionary<TKey, TValue>.FromObjectsAndKeys keys and values are twisted up
* Fixed it in XAMCORE_4_0
* Obsoleted the 2 existing methods
* introduced FromObjectsAndKeys (TValue [] objects, TKey [] keys, nint count)
* Added unit tests with different types for TKey and TValue
2016-06-27 20:38:14 -04:00
Rolf Bjarne Kvinge 7e78269b3c [monotouch-test] Fix a few ModelIO tests according to iOS 10 behavior. (#286) 2016-06-27 15:48:51 -04:00
Rolf Bjarne Kvinge e2c2dc1061 [monotouch-test] Move version-checking code to a shared file. 2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge d9610117a1 [monotouch-test] Ignore NSDataTest.Https on watchOS devices, the API doesn't work. 2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge 343502ef52 [monotouch-test] Disable RuntimeTest.FinalizationRaceCondition/ResurrectedObjectsDisposedTest on watchOS/device, they use too much memory for the device. 2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge d8b4fff4e3 [monotouch-test] Disable test that uses TcpClient on watchOS, since TcpClient doesn't work on watchOS. 2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge 8a4178b141 [monotouch-test] Fix registrar/trampoline tests according to watchOS ABI. 2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge 26b1c27b81 [monotouch-test] Disable NSUbiquitousKeyValueStore test, since it doesn't work on watchOS. 2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge df640e61cd [monotouch-test] Disable test that uses TcpListener, since TcpListener doesn't work on watchOS. 2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge e0e5824ce2 [monotouch-test] Set a timeout for UrlSessionTest so that the requests time out before the test itself. 2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge 43da4642f1 [monotouch-test] Implement a non-GUI version of TestRuntime.RunAsync that works on watchOS. 2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge b4bb30c13c [monotouch-test] Adjust tests according to watchOS behavior. 2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge 0a8c6e3342 [tests] Check versions using Xcode version instead of platform version.
This is required to match API to the required platform version,
since our platforms have different version numbers.
2016-06-27 13:07:37 +02:00
Timothy Risi c94d0e7b70 Merge branch 'master' into xcode8 2016-06-23 10:45:09 -08:00
Vincent Dondain ca718991df [introspection] Fix bindings so the tests pass (#254)
- Added missing NSCopying, NSCoding and NSSecureCoding.
- Filled radar://26939747 with Apple - https://trello.com/c/6aIzLH4a
2016-06-22 17:32:00 -04:00
Sebastien Pouliot 004fe2f8d8 [tests][monotouch] More adjustments for iOS10 related failures/changes (#239)
* [tests][monotouch] More adjustments for iOS10 related failures/changes

- some might be Apple bugs and need to be reverted later

* Fix more failures on monotouch-tests wrt iOS 10

* MutableContactTest.cs: Wrong assert was changed (which is why each one
  needs it's own unique string)

* TrustTest.cs: Fixed as results vary on < iOS9, iOS9 and iOS10

* NetworkReachabilityTest.cs: Fixed as results vary on < iOS9, iOS9 and iOS10

Those

[FAIL] UserDefaultsTest.Ctor_UserName : System.NullReferenceException : Object reference not set to an instance of an object
[FAIL] UserDefaultsTest.SetString : StringForKey-2

are due to

http://stackoverflow.com/questions/37840288/ios-10-nsuserdefaults-does-not-work

and should disappear once the bots are rebooted.
2016-06-22 16:28:27 -04:00
Rolf Bjarne Kvinge c560fee268 [registrar] Managed characters are equivalent to shorts in native code. (#259)
Fixes NSCharacterSetTest.NSMutableCharacterSet_TestStaticSets when
running with the P/Invoke wrapper (for exceptions) enabled (i.e.
watchOS), since otherwise the wrapper would truncate char parameters
to byte.
2016-06-22 05:47:13 -07:00