Skip to content

Commit

Permalink
Bump to mono/mono/2019-10@c0c5c7 (#4286)
Browse files Browse the repository at this point in the history
Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1070776/
Context: mono/mono#18764
Context: mono/mono#18832

Changes: mono/mono@1cca0cf...c0c5c78

  * mono/mono@c0c5c78e2bd: Bump bockbuild to bring in Gtk# regression fix (#18912)
  * mono/mono@a644983ae82: [2019-10] Make MonoWebRequestHandler linker friendly (#18835)
  * mono/mono@85f47fae28e: Move HttpClientHandlerTests.Android.cs to nunit (#18888)
  * mono/mono@26afa2d5bb7: [2019-10] Bump msbuild to track mono-2019-10 (#18861)
  * mono/mono@e5f0d5d928a: [2019-10] [merp] Increase buffer size for state dump (#18838)
  * mono/mono@e60eabc7670: Move offsets-tool into mono/tools (#18783) (#18831)
  * mono/mono@7a59bf3ea51: [2019-10] Bump msbuild to track mono-2019-10 (#18791)
  * mono/mono@47bb780c8d7: [2019-10] Allow users to switch to MonoWebRequestHandler on Android via UI (#18787)
  * mono/mono@d6f592717e1: Bump bockbuild to get GTK NSPasteboardType change.
  * mono/mono@1ee12f86258: Update deprecated query parameter to header (#18705)
  * mono/mono@87201428343: [iOS] Replace removed dsymutil `-t` switch with `-num-threads` (#18743)
  * mono/mono@83c161f2766: Skip WebAssembly build in sdks archive build on non-master branches
  * mono/mono@0e18125d711: [merp] Add an exception type for managed exceptions (#18722)
  * mono/mono@82fffe07497: [runtime] Disable lldb backtrace display on osx, it hangs on attaching in lldb.

d16-4 broke NTLM Authentication with `HttpClient` in Xamarin.Android.

To now use NTLM Authentication, the `$(AndroidHttpClientHandlerType)`
MSBuild variable must be overridden from the default value:

	<PropertyGroup>
	  <AndroidHttpClientHandlerType>System.Net.Http.MonoWebRequestHandler, System.Net.Http</AndroidHttpClientHandlerType>
	</PropertyGroup>

See mono/mono#18764 for more details.
  • Loading branch information
EgorBo authored Feb 20, 2020
1 parent ca7bddb commit 988c811
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .external
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
xamarin/monodroid:d16-5@dab75e88055c1bfaf53f810b0c3a9218fc53c60a
mono/mono:2019-10@1cca0cfebfcbd019c6f2bdd3e5b99f769f1e2e0c
mono/mono:2019-10@c0c5c78e2bdbdbf7a70ae10b0a698708f1f2edbe
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,31 @@ static AssemblyDefinition CreateFauxMonoAndroidAssembly ()
return assm;
}

[Test]
public void PreserveAndroidHttpClientHandler ()
private void PreserveCustomHttpClientHandler (string handlerType, string handlerAssembly, string testProjectName, string assemblyPath)
{
var handlerType = "Xamarin.Android.Net.AndroidClientHandler";
var proj = new XamarinAndroidApplicationProject () { IsRelease = true };
proj.AddReferences ("System.Net.Http");
proj.SetProperty (proj.ActiveConfigurationProperties, "AndroidHttpClientHandlerType", handlerType);
string handlerTypeFullName = string.IsNullOrEmpty(handlerAssembly) ? handlerType : handlerType + ", " + handlerAssembly;
proj.SetProperty (proj.ActiveConfigurationProperties, "AndroidHttpClientHandlerType", handlerTypeFullName);
proj.MainActivity = proj.DefaultMainActivity.Replace ("base.OnCreate (bundle);", "base.OnCreate (bundle);\nvar client = new System.Net.Http.HttpClient ();");
using (var b = CreateApkBuilder ("temp/PreserveAndroidHttpClientHandler")) {
using (var b = CreateApkBuilder (testProjectName)) {
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");

using (var assembly = AssemblyDefinition.ReadAssembly (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android/assets/Mono.Android.dll"))) {
Assert.IsTrue (assembly.MainModule.GetType (handlerType) != null, "Xamarin.Android.Net.AndroidClientHandler should have been preserved by the linker.");
using (var assembly = AssemblyDefinition.ReadAssembly (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, assemblyPath))) {
Assert.IsTrue (assembly.MainModule.GetType (handlerType) != null, $"'{handlerTypeFullName}' should have been preserved by the linker.");
}
}
}

[Test]
public void PreserveCustomHttpClientHandlers ()
{
PreserveCustomHttpClientHandler ("Xamarin.Android.Net.AndroidClientHandler", "",
"temp/PreserveAndroidHttpClientHandler", "android/assets/Mono.Android.dll");
PreserveCustomHttpClientHandler ("System.Net.Http.MonoWebRequestHandler", "System.Net.Http",
"temp/PreserveMonoWebRequestHandler", "android/assets/System.Net.Http.dll");
}

[Test]
public void WarnAboutAppDomainsRelease ()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ MonoTests.System.Web.Services.Description.ServiceDescriptionTest.ReadAndRetrieva
MonoTests.System.Web.Services.Description.ServiceDescriptionTest.ReadInvalid
MonoTests.System.Web.Services.Description.ServiceDescriptionTest.SimpleWrite
MonoTests.System.Web.Services.Description.ServiceDescriptionTest.ValidatingRead

# the test is incorrect and will be removed soon: https://github.com/mono/mono/pull/18952
System.Net.Http.Tests.HttpClientHandlerTestsAndroid.TestEnvVarSwitchForInnerHttpHandler

0 comments on commit 988c811

Please sign in to comment.