You've already forked linux-packaging-mono
Imported Upstream version 4.2.0.207
Former-commit-id: f90f74cb984aa12eac8e2a357db43169ae7378e5
This commit is contained in:
committed by
Jo Shields
parent
6992685b86
commit
afe402035c
@@ -170,9 +170,16 @@ namespace System {
|
||||
}
|
||||
}
|
||||
|
||||
// When used instead of UriKind.RelativeOrAbsolute paths such as "/foo" are assumed relative.
|
||||
const UriKind DotNetRelativeOrAbsolute = (UriKind) 300;
|
||||
|
||||
public Uri (string uriString, UriKind uriKind)
|
||||
{
|
||||
source = uriString;
|
||||
|
||||
if (uriString != null && uriKind == DotNetRelativeOrAbsolute)
|
||||
uriKind = (uriString.StartsWith ("/", StringComparison.Ordinal))? UriKind.Relative : UriKind.RelativeOrAbsolute;
|
||||
|
||||
ParseUri (uriKind);
|
||||
|
||||
switch (uriKind) {
|
||||
@@ -205,6 +212,9 @@ namespace System {
|
||||
return;
|
||||
}
|
||||
|
||||
if (uriKind == DotNetRelativeOrAbsolute)
|
||||
uriKind = (uriString.StartsWith ("/", StringComparison.Ordinal))? UriKind.Relative : UriKind.RelativeOrAbsolute;
|
||||
|
||||
if (uriKind != UriKind.RelativeOrAbsolute &&
|
||||
uriKind != UriKind.Absolute &&
|
||||
uriKind != UriKind.Relative) {
|
||||
|
@@ -48,7 +48,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void ServerHandshakeReturnCrapStatusCodeTest ()
|
||||
{
|
||||
// On purpose,
|
||||
@@ -65,7 +65,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void ServerHandshakeReturnWrongUpgradeHeader ()
|
||||
{
|
||||
#pragma warning disable 4014
|
||||
@@ -84,7 +84,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void ServerHandshakeReturnWrongConnectionHeader ()
|
||||
{
|
||||
#pragma warning disable 4014
|
||||
@@ -105,7 +105,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // The test hangs when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
[Category ("MobileNotWorking")] // The test hangs when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void EchoTest ()
|
||||
{
|
||||
const string Payload = "This is a websocket test";
|
||||
@@ -130,7 +130,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void CloseOutputAsyncTest ()
|
||||
{
|
||||
Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
|
||||
@@ -147,7 +147,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void CloseAsyncTest ()
|
||||
{
|
||||
Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
|
||||
@@ -164,7 +164,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test, ExpectedException (typeof (ArgumentNullException))]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void SendAsyncArgTest_NoArray ()
|
||||
{
|
||||
Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
|
||||
@@ -178,7 +178,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test, ExpectedException (typeof (ArgumentNullException))]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void ReceiveAsyncArgTest_NoArray ()
|
||||
{
|
||||
Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
|
||||
@@ -186,7 +186,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void ReceiveAsyncWrongState_Closed ()
|
||||
{
|
||||
try {
|
||||
@@ -201,7 +201,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void SendAsyncWrongState_Closed ()
|
||||
{
|
||||
try {
|
||||
@@ -216,7 +216,7 @@ namespace MonoTests.System.Net.WebSockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
[Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
|
||||
public void SendAsyncWrongState_CloseSent ()
|
||||
{
|
||||
try {
|
||||
|
@@ -1940,6 +1940,20 @@ namespace MonoTests.System
|
||||
Assert.AreEqual ("id=1%262&sort=asc", escaped, "UriEscaped");
|
||||
}
|
||||
|
||||
// When used, paths such as "/foo" are assumed relative.
|
||||
static UriKind DotNetRelativeOrAbsolute = (Type.GetType ("Mono.Runtime") == null)? UriKind.RelativeOrAbsolute : (UriKind) 300;
|
||||
|
||||
[Test]
|
||||
public void DotNetRelativeOrAbsoluteTest ()
|
||||
{
|
||||
var uri1 = new Uri ("/foo", DotNetRelativeOrAbsolute);
|
||||
Assert.IsFalse (uri1.IsAbsoluteUri);
|
||||
|
||||
Uri uri2;
|
||||
Uri.TryCreate("/foo", DotNetRelativeOrAbsolute, out uri2);
|
||||
Assert.IsFalse (uri2.IsAbsoluteUri);
|
||||
}
|
||||
|
||||
[Test]
|
||||
// Bug #12631
|
||||
public void LocalPathWithBaseUrl ()
|
||||
|
Reference in New Issue
Block a user