Imported Upstream version 3.10.0

Former-commit-id: 172c8e3c300b39d5785c7a3e8dfb08ebdbc1a99b
This commit is contained in:
Jo Shields
2014-10-04 11:27:48 +01:00
parent fe777c5c82
commit 8b9b85e7f5
970 changed files with 20242 additions and 31308 deletions

View File

@@ -62,7 +62,7 @@ using System.Runtime.CompilerServices;
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
#if !(TARGET_JVM || TARGET_DOTNET)
#if !(TARGET_DOTNET)
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../winfx.pub")]
#endif

View File

@@ -7,7 +7,6 @@ using System.Xml.Serialization;
using System.Xml.Xsl;
using Microsoft.Win32;
#if !TARGET_JVM
namespace HtmlAgilityPack
{
/// <summary>
@@ -821,4 +820,3 @@ namespace HtmlAgilityPack
}
}
}
#endif

View File

@@ -23,58 +23,6 @@ namespace HtmlAgilityPack
File.Copy(source, target, true);
}
}
#if TARGET_JVM1
internal struct HtmlLibrary
{
[Conditional("DEBUG")]
internal static void GetVersion(out string version)
{
System.Diagnostics.StackFrame sf = new System.Diagnostics.StackFrame(1, true);
version = sf.GetMethod().DeclaringType.Assembly.GetName().Version.ToString();
}
[Conditional("DEBUG")]
[Conditional("TRACE")]
internal static void Trace(object Value)
{
// category is the method
string name = null;
GetCurrentMethodName(2, out name);
System.Diagnostics.Trace.WriteLine(Value, name);
}
[Conditional("DEBUG")]
[Conditional("TRACE")]
internal static void TraceStackFrame(int steps)
{
string name = null;
GetCurrentMethodName(2, out name);
string trace = "";
for(int i=1;i<steps;i++)
{
System.Diagnostics.StackFrame sf = new System.Diagnostics.StackFrame(i, true);
trace += sf.ToString();
}
System.Diagnostics.Trace.WriteLine(trace, name);
System.Diagnostics.Trace.WriteLine("");
}
[Conditional("DEBUG")]
internal static void GetCurrentMethodName(out string name)
{
name = null;
GetCurrentMethodName(2, out name);
}
[Conditional("DEBUG")]
internal static void GetCurrentMethodName(int skipframe, out string name)
{
StackFrame sf = new StackFrame(skipframe, true);
name = sf.GetMethod().DeclaringType.Name + "." + sf.GetMethod().Name;
}
}
#endif
internal class HtmlCmdLine
{

View File

@@ -1,7 +1,3 @@
#if TARGET_JVM
#define BUG_78521_FIXED
#endif
using System;
using System.Web.UI;
@@ -106,11 +102,8 @@ namespace MonoTests.SystemWeb.Framework
_page = (Page) parameters[0];
#if NET_2_0
#if BUG_78521_FIXED
_page.PreInit += OnPreInit;
#else
OnPreInit (null, null);
#endif
_page.LoadComplete += OnLoadComplete;
_page.PreLoad += OnPreLoad;
_page.PreRenderComplete += OnPreRenderComplete;

View File

@@ -1,7 +1,3 @@
#if TARGET_JVM
#define BUG_78521_FIXED
#endif
using System;
using System.Web.UI;
using MonoTests.SystemWeb.Framework;
@@ -9,11 +5,7 @@ using MonoTests.SystemWeb.Framework;
public partial class MyPage : System.Web.UI.Page
{
//FIXME: mono defines its own constructor here
#if BUG_78521_FIXED
public MyPage ()
#else
protected override void OnPreInit (EventArgs e)
#endif
{
WebTest t = WebTest.CurrentTest;
if (t != null)

View File

@@ -1,7 +1,3 @@
#if TARGET_JVM_FOR_WEBTEST
#define TARGET_JVM
#endif
using System;
using System.Reflection;
using System.IO;
@@ -202,7 +198,6 @@ namespace MonoTests.SystemWeb.Framework
/// </summary>
public static void CleanApp ()
{
#if !TARGET_JVM
if (host != null) {
lock (_appUnloadedSync) {
EventHandler handler = new EventHandler(PulseAppUnloadedSync);
@@ -218,7 +213,6 @@ namespace MonoTests.SystemWeb.Framework
baseDir = null;
binDir = null;
}
#endif
}
private static object _appUnloadedSync = new object();
@@ -305,7 +299,6 @@ namespace MonoTests.SystemWeb.Framework
{
if (type == null)
throw new ArgumentNullException ("type");
#if !TARGET_JVM
using (Stream source = type.Assembly.GetManifestResourceStream (resourceName)) {
if (source == null)
throw new ArgumentException ("resource not found: " + resourceName, "resourceName");
@@ -313,7 +306,6 @@ namespace MonoTests.SystemWeb.Framework
source.Read (array, 0, array.Length);
CopyBinary (array, targetUrl);
}
#endif
}
public static void CopyPrefixedResources (Type type, string namePrefix, string targetDir)
@@ -347,9 +339,6 @@ namespace MonoTests.SystemWeb.Framework
/// <example><code>CopyBinary (System.Text.Encoding.UTF8.GetBytes ("Hello"), "App_Data/Greeting.txt");</code></example>
public static string CopyBinary (byte[] sourceArray, string targetUrl)
{
#if TARGET_JVM
return null;
#else
EnsureWorkingDirectories ();
EnsureDirectoryExists (Path.Combine (baseDir, Path.GetDirectoryName (targetUrl)));
string targetFile = Path.Combine (baseDir, targetUrl);
@@ -386,7 +375,6 @@ namespace MonoTests.SystemWeb.Framework
}
return targetFile;
#endif
}
static WebTestResourcesSetupAttribute.SetupHandler CheckResourcesSetupHandler ()
@@ -408,14 +396,9 @@ namespace MonoTests.SystemWeb.Framework
{
if (host != null)
return;
#if TARGET_JVM
host = new MyHost ();
return;
#else
host = AppDomain.CurrentDomain.GetData (HOST_INSTANCE_NAME) as MyHost;
if (host == null)
SetupHosting ();
#endif
}
public static void SetupHosting ()
@@ -425,16 +408,10 @@ namespace MonoTests.SystemWeb.Framework
public static void SetupHosting (WebTestResourcesSetupAttribute.SetupHandler resHandler)
{
#if !TARGET_JVM
if (host == null)
host = AppDomain.CurrentDomain.GetData (HOST_INSTANCE_NAME) as MyHost;
#endif
if (host != null)
CleanApp ();
#if TARGET_JVM
host = new MyHost ();
return;
#else
if (resHandler == null)
resHandler = CheckResourcesSetupHandler ();
if (resHandler == null)
@@ -452,7 +429,6 @@ namespace MonoTests.SystemWeb.Framework
AppDomain.CurrentDomain.SetData (HOST_INSTANCE_NAME, host);
host.AppDomain.SetData (HOST_INSTANCE_NAME, host);
host.AppDomain.DomainUnload += new EventHandler (_unloadHandler.OnUnload);
#endif
}
private static UnloadHandler _unloadHandler = new UnloadHandler();
@@ -485,7 +461,6 @@ namespace MonoTests.SystemWeb.Framework
public void OnUnload (object o, EventArgs args)
{
#if !TARGET_JVM
// Block new requests from starting
lock (_syncUnloading) {
// Wait for pending requests to finish
@@ -501,7 +476,6 @@ namespace MonoTests.SystemWeb.Framework
if (handler != null)
handler(this, null);
}
#endif
}
}
@@ -509,15 +483,10 @@ namespace MonoTests.SystemWeb.Framework
public static string TestBaseDir {
get {
#if !TARGET_JVM
return baseDir;
#else
return String.Empty;
#endif
}
}
#if !TARGET_JVM
const string VIRTUAL_BASE_DIR = "/NunitWeb";
private static string baseDir;
private static string binDir;
@@ -608,6 +577,5 @@ namespace MonoTests.SystemWeb.Framework
}
static partial void CopyResourcesLocal ();
#endif
}
}