Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@ -251,7 +251,6 @@ namespace MonoTests.System.Web.UI {
Assert.AreEqual (0, ac.CssStyle.Count, "AttributeCollection.Count");
}
#if NET_2_0
[Test]
public void Count4 ()
{
@ -266,7 +265,6 @@ namespace MonoTests.System.Web.UI {
Assert.AreEqual (0, ac.Count, "AttributeCollection.Count");
Assert.AreEqual (0, ac.CssStyle.Count, "AttributeCollection.Count");
}
#endif
}
}

View File

@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.IO;
@ -190,4 +189,3 @@ namespace MonoTests.System.Web.UI {
}
}
#endif

View File

@ -27,7 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#if NET_2_0
using System;
using System.Web;
@ -559,7 +558,6 @@ namespace MonoTests.System.Web.UI
}
}
}
#endif

View File

@ -72,7 +72,6 @@ namespace MonoCasTests.System.Web.UI {
Assert.IsNull (c.Site, "Site");
Assert.AreEqual ("mono", c.UniqueID, "UniqueID");
Assert.IsTrue (c.Visible, "Visible");
#if NET_2_0
c.AppRelativeTemplateSourceDirectory = String.Empty;
Assert.AreEqual (String.Empty, c.AppRelativeTemplateSourceDirectory, "AppRelativeTemplateSourceDirectory");
c.EnableTheming = true;
@ -82,7 +81,6 @@ namespace MonoCasTests.System.Web.UI {
c.TemplateControl = null;
Assert.IsNull (c.TemplateControl, "TemplateControl");
Assert.AreEqual (String.Empty, c.TemplateSourceDirectory, "TemplateSourceDirectory");
#endif
}
private void SetRenderMethodDelegate (HtmlTextWriter writer, Control control)
@ -102,14 +100,11 @@ namespace MonoCasTests.System.Web.UI {
c.RenderControl (writer);
Assert.IsNotNull (c.ResolveUrl (String.Empty), "ResolveUrl");
c.SetRenderMethodDelegate (new RenderMethod (SetRenderMethodDelegate));
#if NET_2_0
c.ApplyStyleSheetSkin (page);
Assert.IsNotNull (c.ResolveClientUrl (String.Empty), "ResolveClientUrl");
#endif
c.Dispose ();
}
#if NET_2_0
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
[ExpectedException (typeof (InvalidOperationException))]
@ -120,7 +115,6 @@ namespace MonoCasTests.System.Web.UI {
c.Focus ();
// normal, no forms on page
}
#endif
private void Handler (object sender, EventArgs e)
{

View File

@ -42,9 +42,7 @@ using MonoTests.SystemWeb.Framework;
using MonoTests.stand_alone.WebHarness;
using MonoTests.Common;
#if NET_2_0
using System.Web.UI.Adapters;
#endif
#if NET_4_0
using System.Web.Routing;
@ -232,7 +230,6 @@ namespace MonoTests.System.Web.UI
string uid1_3 = c1.UniqueID;
Assert.IsFalse (uid1_3 == uid1_2, "id was not reset");
#if NET_2_0
EnsureIDControl c3 = new EnsureIDControl ();
nc.Controls.Add (c3);
string uid3_1 = c3.UniqueID;
@ -243,7 +240,6 @@ namespace MonoTests.System.Web.UI
string uid3_2 = c3.UniqueID;
Assert.IsNull (c3.ID);
Assert.IsFalse (uid3_1 == uid3_2, "id was not reset");
#endif
}
[Test]
@ -258,11 +254,7 @@ namespace MonoTests.System.Web.UI
nc3.Controls.Add (nc2);
nc2.Controls.Add (nc);
nc.Controls.Add (control);
#if NET_2_0
string expected = "ctl00_ctl00_ctl00";
#else
string expected = "_ctl0__ctl0__ctl0";
#endif
Assert.AreEqual (expected, control.ClientID, "ClientID");
}
@ -292,7 +284,6 @@ namespace MonoTests.System.Web.UI
Assert.AreEqual (-1, html.IndexOf ("<span>label</span><span>label</span>"), "#A1");
}
#if NET_2_0
[Test]
[Category("NunitWeb")]
public void AppRelativeTemplateSourceDirectory ()
@ -916,7 +907,6 @@ namespace MonoTests.System.Web.UI
Assert.AreEqual (false, ctrl.EnableTheming, "EnableTheming#2");
}
#endif
[Test]
public void BindingContainer ()
{
@ -943,7 +933,6 @@ namespace MonoTests.System.Web.UI
Assert.IsTrue (Object.ReferenceEquals (child2.NamingContainer, nc), "NamingContainer #2");
Assert.IsTrue (Object.ReferenceEquals (child2.BindingContainer, nc), "BindingContainer #2");
#if NET_2_0
// DetailsViewPagerRow marked to be not BindingContainer
DetailsViewPagerRow row = new DetailsViewPagerRow (0, DataControlRowType.Pager, DataControlRowState.Normal);
TableCell cell = new TableCell ();
@ -954,16 +943,13 @@ namespace MonoTests.System.Web.UI
Assert.IsTrue (Object.ReferenceEquals (child3.NamingContainer, row), "NamingContainer #3");
Assert.IsTrue (Object.ReferenceEquals (child3.BindingContainer, control), "BindingContainer #3");
#endif
}
#if NET_2_0
[Test]
public void Control_Adapter ()
{
MyNC ctr = new MyNC ();
Assert.AreEqual (null, ctr.Adapter (), "Adapter");
}
#endif
[Test]
public void ChildControlsCreated () {
ChildControlsCreatedControl ctr = new ChildControlsCreatedControl ();
@ -975,7 +961,6 @@ namespace MonoTests.System.Web.UI
Assert.AreEqual (1, ctr.Controls.Count, "ChildControlsCreated#2");
}
#if NET_2_0
[Test (Description="Bug #594238")]
public void OverridenControlsPropertyAndPostBack_Bug594238 ()
{
@ -1013,7 +998,6 @@ namespace MonoTests.System.Web.UI
WebTest.CopyResource (GetType (), "OverridenControlsPropertyAndPostBack_Bug594238.aspx", "OverridenControlsPropertyAndPostBack_Bug594238.aspx");
}
#endif
#if NET_4_0
[Test]
public void GetRouteUrl_Object ()
@ -1134,7 +1118,6 @@ namespace MonoTests.System.Web.UI
}
#endif
#region helpcalsses
#if NET_2_0
class ControlWithState : Control
{
string _state;
@ -1187,10 +1170,8 @@ namespace MonoTests.System.Web.UI
}
}
#endif
class MyNC : Control, INamingContainer
{
#if NET_2_0
public ControlAdapter Adapter ()
{
return base.Adapter;
@ -1215,7 +1196,6 @@ namespace MonoTests.System.Web.UI
{
return base.HasEvents ();
}
#endif
}
class DerivedControl : Control
@ -1232,7 +1212,6 @@ namespace MonoTests.System.Web.UI
get { return coll; }
}
#if NET_2_0
public bool DoIsViewStateEnabled
{
get { return IsViewStateEnabled; }
@ -1257,7 +1236,6 @@ namespace MonoTests.System.Web.UI
{
return base.ResolveAdapter ();
}
#endif
}
class NamingContainer : Control, INamingContainer
@ -1293,7 +1271,6 @@ namespace MonoTests.System.Web.UI
#endregion
}
#if NET_2_0
public class Customadaptercontrol : Control
{
public new ControlAdapter Adapter {
@ -1315,7 +1292,6 @@ namespace MonoTests.System.Web.UI
EnsureID ();
}
}
#endif
public class ChildControlsCreatedControl : Control
{

View File

@ -63,14 +63,12 @@ namespace MonoCasTests.System.Web.UI {
css.Add ("monkey", "mono");
css.Remove ("monkey");
css.Clear ();
#if NET_2_0
css[HtmlTextWriterStyle.Top] = "1";
Assert.AreEqual ("1", css[HtmlTextWriterStyle.Top], "this[HtmlTextWriterStyle]");
Assert.IsNotNull (css.Value, "Value");
css.Value = String.Empty;
css.Add (HtmlTextWriterStyle.Left, "1");
css.Remove (HtmlTextWriterStyle.Left);
#endif
}
// LinkDemand

View File

@ -46,7 +46,6 @@ namespace MonoTests.System.Web.UI
public class CssStyleCollectionTest
{
#if NET_2_0
[Test]
public void CssStyleCollection_BackgroundImage () {
WebControl c = new WebControl (HtmlTextWriterTag.A);
@ -60,7 +59,6 @@ namespace MonoTests.System.Web.UI
Assert.AreEqual ("background-image:url(" + url_encoded + ");", css.Value, "CssStyleCollection_BackgroundImage#3");
Assert.AreEqual ("background-image:url(" + url_encoded + ");", c.Attributes["style"], "CssStyleCollection_BackgroundImage#4");
}
#endif
[Test]
public void CssStyleCollection_BackgroundImage2 () {
@ -72,9 +70,7 @@ namespace MonoTests.System.Web.UI
css.Add ("background-image", url);
Assert.AreEqual (url, css ["background-image"], "CssStyleCollection_BackgroundImage#1");
#if NET_2_0
Assert.AreEqual ("background-image:url(" + url_encoded + ");", css.Value, "CssStyleCollection_BackgroundImage#3");
#endif
Assert.AreEqual ("background-image:url(" + url_encoded + ");", c.Attributes ["style"], "CssStyleCollection_BackgroundImage#4");
}
@ -88,9 +84,7 @@ namespace MonoTests.System.Web.UI
css.Add ("background-image", "url(" + url_encoded + ")");
Assert.AreEqual ("url(" + url_encoded + ")", css ["background-image"], "CssStyleCollection_BackgroundImage#1");
#if NET_2_0
Assert.AreEqual ("background-image:url(" + url_encoded + ");", css.Value, "CssStyleCollection_BackgroundImage#3");
#endif
Assert.AreEqual ("background-image:url(" + url_encoded + ");", c.Attributes ["style"], "CssStyleCollection_BackgroundImage#4");
}
@ -104,9 +98,7 @@ namespace MonoTests.System.Web.UI
c.Attributes ["style"] = "background-image:url(" + url_encoded + ");";
Assert.AreEqual ("url(" + url_encoded + ")", css ["background-image"], "CssStyleCollection_BackgroundImage#1");
#if NET_2_0
Assert.AreEqual ("background-image:url(" + url_encoded + ");", css.Value, "CssStyleCollection_BackgroundImage#3");
#endif
Assert.AreEqual ("background-image:url(" + url_encoded + ");", c.Attributes ["style"], "CssStyleCollection_BackgroundImage#4");
}
@ -119,9 +111,7 @@ namespace MonoTests.System.Web.UI
c.Attributes ["style"] = "padding: 0px; margin: 0px";
Assert.AreEqual (2, c.Style.Count, "Style Count");
#if NET_2_0
Assert.AreEqual (3, c.ControlStyle.GetStyleAttributes (c).Count, "ControlStyle Count");
#endif
CssStyleCollection col = c.Style;
NameValueCollection styles = new NameValueCollection ();
@ -176,21 +166,10 @@ namespace MonoTests.System.Web.UI
public void CssStyleCollection_case_sensitive () {
WebControl c = new WebControl (HtmlTextWriterTag.A);
c.Style.Add ("color", "red");
#if NET_2_0
Assert.AreEqual ("red", c.Style ["Color"], "");
#else
Assert.AreEqual (null, c.Style ["Color"], "");
Assert.AreEqual ("red", c.Style ["color"], "");
#endif
c.Style.Add ("Color", "Blue");
#if NET_2_0
Assert.AreEqual ("Blue", c.Style ["color"], "");
Assert.AreEqual (1, c.Style.Count, "Style Count");
#else
Assert.AreEqual ("red", c.Style ["color"], "");
Assert.AreEqual ("Blue", c.Style ["Color"], "");
Assert.AreEqual (2, c.Style.Count, "Style Count");
#endif
}
}
}

View File

@ -81,7 +81,6 @@ namespace MonoCasTests.System.Web.UI {
DataBinder.GetPropertyValue (null, "Data", "{0}");
}
#if NET_2_0
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
public void GetDataItem_Deny_Unrestricted ()
@ -91,7 +90,6 @@ namespace MonoCasTests.System.Web.UI {
Assert.IsNull (DataBinder.GetDataItem (null, out found), "GetDataItem(object,out bool)");
Assert.IsFalse (found, "found");
}
#endif
// LinkDemand

View File

@ -71,18 +71,14 @@ namespace MonoCasTests.System.Web.UI {
dbc.Add (db);
dbc.Remove ("property");
dbc.Remove ("property", true);
#if NET_2_0
dbc.Changed += new EventHandler (Handler);
Assert.IsFalse (dbc.Contains ("property"), "Contains");
dbc.Changed -= new EventHandler (Handler);
#endif
}
#if NET_2_0
private void Handler (object sender, EventArgs e)
{
}
#endif
// LinkDemand
public override Type Type {

View File

@ -34,7 +34,6 @@ using System.Security.Permissions;
using System.Web;
using System.Web.UI;
#if NET_2_0
namespace MonoCasTests.System.Web.UI {
@ -65,4 +64,3 @@ namespace MonoCasTests.System.Web.UI {
}
}
#endif

View File

@ -52,7 +52,6 @@ namespace MonoCasTests.System.Web.UI {
Assert.AreEqual ("monkeymono", dblc.Text, "Text");
}
#if NET_2_0
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
[ExpectedException (typeof (NotSupportedException))]
@ -63,7 +62,6 @@ namespace MonoCasTests.System.Web.UI {
// setter throw
tc.Text = "singe";
}
#endif
// LinkDemand

View File

@ -23,7 +23,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Collections;
using System.Collections.Generic;
@ -125,4 +124,3 @@ namespace MonoTests.System.Web.UI
}
}
}
#endif

View File

@ -25,7 +25,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using NUnit.Framework;
@ -199,4 +198,3 @@ namespace MonoCasTests.System.Web.UI
}
}
}
#endif

View File

@ -58,7 +58,6 @@ namespace MonoCasTests.System.Web.UI {
Assert.AreEqual (String.Empty, dtpd.DocumentUrl, "DocumentUrl");
Assert.AreEqual ("parseText", dtpd.ParseText, "ParseText");
}
#if NET_2_0
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
public void Ctor3_Deny_Unrestricted ()
@ -69,7 +68,6 @@ namespace MonoCasTests.System.Web.UI {
Assert.IsTrue (dtpd.ShouldApplyTheme, "ShouldApplyTheme");
Assert.IsNull (dtpd.UserControlRegisterEntries, "UserControlRegisterEntries");
}
#endif
// LinkDemand
public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)

View File

@ -68,9 +68,6 @@ namespace MonoCasTests.System.Web.UI {
[Test]
[SecurityPermission (SecurityAction.PermitOnly, ControlThread = true, UnmanagedCode = true)]
#if ONLY_1_1
[ExpectedException (typeof (NullReferenceException))]
#endif
public void ParseControl_PermitOnly_ControlThreadUnmanagedCode ()
{
DesignTimeTemplateParser.ParseControl (dtpd);
@ -94,14 +91,10 @@ namespace MonoCasTests.System.Web.UI {
[Test]
[SecurityPermission (SecurityAction.PermitOnly, ControlThread = true, UnmanagedCode = true)]
#if ONLY_1_1
[ExpectedException (typeof (NullReferenceException))]
#endif
public void ParseTemplate_PermitOnly_ControlThreadUnmanagedCode ()
{
DesignTimeTemplateParser.ParseTemplate (dtpd);
}
#if NET_2_0
[Test]
[SecurityPermission (SecurityAction.Deny, ControlThread = true)]
[ExpectedException (typeof (SecurityException))]
@ -145,7 +138,6 @@ namespace MonoCasTests.System.Web.UI {
{
DesignTimeTemplateParser.ParseTheme (null, "theme", "path");
}
#endif
// LinkDemand
@ -159,10 +151,6 @@ namespace MonoCasTests.System.Web.UI {
return mi.Invoke (null, new object[1] { dtpd });
}
catch (TargetInvocationException tie) {
#if ONLY_1_1
if (tie.InnerException is NullReferenceException)
return String.Empty;
#endif
throw tie;
}
}

View File

@ -51,14 +51,12 @@ namespace MonoCasTests.System.Web.UI {
private void Deny_Unrestricted (Html32TextWriter htw)
{
#if NET_2_0
htw.ShouldPerformDivTableSubstitution = true;
Assert.IsTrue (htw.ShouldPerformDivTableSubstitution, "ShouldPerformDivTableSubstitution");
htw.SupportsBold = true;
Assert.IsTrue (htw.SupportsBold, "SupportsBold");
htw.SupportsItalic = true;
Assert.IsTrue (htw.SupportsItalic, "SupportsItalic");
#endif
htw.RenderBeginTag (HtmlTextWriterTag.Table);
htw.RenderBeginTag ("<tr>");
htw.RenderEndTag ();

View File

@ -381,12 +381,7 @@ namespace MonoTests.System.Web.UI {
w.RenderBeginTag ("div");
w.RenderEndTag ();
#if NET_2_0
Assert.AreEqual ("<div style=\"background-image:url(http://www.go-mono.com/);\">\n\n</div>", sw.ToString ());
#else
// the url(...) is missing in fx 1.x
Assert.AreEqual ("<div style=\"background-image:http://www.go-mono.com/;\">\n\n</div>", sw.ToString ());
#endif
}
[Test]
@ -399,13 +394,9 @@ namespace MonoTests.System.Web.UI {
w1.AddStyleAttribute ("mystyle", "my value&space");
w1.RenderBeginTag ("div");
w1.RenderEndTag ();
#if NET_2_0
Assert.AreEqual ("my value&space", w1.StyleValue_At_AddStyleAttribute, "StyleValue_At_AddStyleAttribute");
Assert.AreEqual ("my value&amp;space", w1.StyleValue_At_OnStyleAttributeRender, "StyleValue_At_OnStyleAttributeRender");
Assert.AreEqual ("<div style=\"mystyle:my value&amp;space;\">\n\n</div>", sw.ToString ());
#else
Assert.AreEqual ("<div style=\"mystyle:my value&space;\">\n\n</div>", sw.ToString ());
#endif
}
[Test]
@ -450,7 +441,6 @@ namespace MonoTests.System.Web.UI {
Assert.AreEqual ("mystyle:my value&amp;space;", sw.ToString ());
}
#if NET_2_0
[Test]
public void WriteStyleAttribute_BackgroundImage1 ()
{
@ -513,7 +503,6 @@ namespace MonoTests.System.Web.UI {
Assert.AreEqual ("<div style=\"BackGround-Image:url(http://www.mainsoft.com/space%20here?a=b&amp;c=d);\">\n\n</div>", sw.ToString ());
}
#endif
[Test]
public void AddStyleAttribute2 ()
@ -554,14 +543,12 @@ namespace MonoTests.System.Web.UI {
Assert.AreEqual ("<div>\n\n</div>", sw.ToString ());
}
#if NET_2_0
[Test]
public void WriteBreakTest ()
{
w.WriteBreak ();
Assert.AreEqual ("<br />", sw.ToString (), "WriteBreakTest01");
}
#endif
class MyHttpTextWriter : HtmlTextWriter {
int i = 0;

View File

@ -67,14 +67,12 @@ namespace MonoCasTests.System.Web.UI {
LosFormatter lf = new LosFormatter (true, String.Empty);
}
#if NET_2_0
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
public void CtorBoolByteArray_Deny_Unrestricted ()
{
LosFormatter lf = new LosFormatter (true, (byte[])null);
}
#endif
// LinkDemand

View File

@ -217,11 +217,7 @@ namespace MonoTests.System.Web.UI
StringWriter sw = new StringWriter ();
lf.Serialize (sw, s);
string s1 = sw.ToString ();
#if NET_2_0
Assert.AreEqual ("/wEFC0hlbGxvIHdvcmxk", s1, "#1");
#else
Assert.AreEqual ("SGVsbG8gd29ybGQ=", s1, "#1");
#endif
string s2 = lf.Deserialize (s1) as string;
Assert.IsNotNull (s2, "#2");
Assert.AreEqual (s, s2, "#3");
@ -253,11 +249,7 @@ namespace MonoTests.System.Web.UI
MemoryStream ms = new MemoryStream ();
lf.Serialize (ms, s);
string s1 = Encoding.UTF8.GetString (ms.GetBuffer (), 0, (int) ms.Length);
#if NET_2_0
Assert.AreEqual ("/wEFC0hlbGxvIHdvcmxk", s1, "#1");
#else
Assert.AreEqual ("SGVsbG8gd29ybGQ=", s1, "#1");
#endif
string s2 = lf.Deserialize (s1) as string;
Assert.IsNotNull (s2, "#2");
Assert.AreEqual (s, s2, "#3");
@ -287,20 +279,12 @@ namespace MonoTests.System.Web.UI
MemoryStream ms = new MemoryStream ();
lf.Serialize (ms, null);
string s1 = Encoding.UTF8.GetString (ms.GetBuffer (), 0, (int) ms.Length);
#if NET_2_0
Assert.AreEqual ("/wFk", s1, "#1");
#else
Assert.AreEqual (string.Empty, s1, "#1");
#endif
StringWriter sw = new StringWriter ();
lf.Serialize (sw, null);
string s2 = sw.ToString ();
#if NET_2_0
Assert.AreEqual ("/wFk", s1, "#2");
#else
Assert.AreEqual (string.Empty, s1, "#2");
#endif
}
class NonSeekableStream : MemoryStream

View File

@ -39,7 +39,6 @@ using NUnit.Framework;
using MonoTests.Common;
#if NET_2_0
namespace MonoTests.System.Web.UI {
[TestFixture]
@ -139,4 +138,3 @@ namespace MonoTests.System.Web.UI {
}
}
}
#endif

Some files were not shown because too many files have changed in this diff Show More