Imported Upstream version 5.16.0.100

Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-08-07 15:19:03 +00:00
parent 0a9828183b
commit 7d7f676260
4419 changed files with 170950 additions and 90273 deletions

View File

@@ -223,7 +223,8 @@ TEST_RESOURCE_FILES = \
Test/mainsoft/NunitWebResources/CheckBoxList_Bug600415.aspx \
Test/mainsoft/NunitWebResources/BoundField_Bug646505.aspx \
Test/mainsoft/NunitWebResources/BoundField_Bug646505.aspx.cs \
Test/mainsoft/NunitWebResources/HtmlTitleCodeRender_Bug662918.aspx
Test/mainsoft/NunitWebResources/HtmlTitleCodeRender_Bug662918.aspx \
Test/mainsoft/NunitWebResources/CheckBoxList_CustomValues.aspx
RESOURCE_DEFS = \
TranslationResources,resources/TranslationResources.resx

View File

@@ -155,7 +155,7 @@ namespace System.Web.Security
// incorrect cookie value, suppress the exception
return;
}
if (ticket == null || (!ticket.IsPersistent && ticket.Expired))
if (ticket == null || ticket.Expired)
return;
FormsAuthenticationTicket oldticket = ticket;

View File

@@ -253,7 +253,10 @@ namespace System.Web.UI.HtmlControls
if (cookieless) {
Uri current_uri = new Uri ("http://host" + current_path);
Uri fp_uri = new Uri ("http://host" + file_path);
//Determine if the file_path is rooted (ie starts with a '/')
//and inject a '/' into the Uri string accordingly.
string separator = file_path[0] == '/' ? "" : "/";
Uri fp_uri = new Uri ("http://host" + separator + file_path);
action = fp_uri.MakeRelative (current_uri);
} else
action = current_path;

View File

@@ -35,9 +35,6 @@ namespace System.Web.UI.WebControls.WebParts
{
public interface IPersonalizable
{
void Load (IDictionary sharedState, IDictionary userState);
void Save (IDictionary state);
bool IsDirty { get; }
}
}

View File

@@ -192,10 +192,17 @@ namespace System.Web.UI.WebControls
if (checkbox == -1)
return false;
string val = postCollection [postDataKey];
bool ischecked = val == "on";
ListItem item = Items [checkbox];
if (item.Enabled) {
string val = postCollection [postDataKey];
bool ischecked = val == "on";
#if NET_4_0
if (!RenderingCompatibilityLessThan40) {
ischecked = val == item.Value;
}
#endif
if (ischecked && !item.Selected) {
item.Selected = true;
return true;

View File

@@ -37,6 +37,7 @@ using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Collections;
using System.Text.RegularExpressions;
using MonoTests.SystemWeb.Framework;
using MonoTests.stand_alone.WebHarness;
using System.Collections.Specialized;
@@ -133,6 +134,7 @@ namespace MonoTests.System.Web.UI.WebControls {
WebTest.CopyResource (t, "CheckBoxList_Bug377703_2.aspx", "CheckBoxList_Bug377703_2.aspx");
WebTest.CopyResource (t, "CheckBoxList_Bug578770.aspx", "CheckBoxList_Bug578770.aspx");
WebTest.CopyResource (t, "CheckBoxList_Bug600415.aspx", "CheckBoxList_Bug600415.aspx");
WebTest.CopyResource (t, "CheckBoxList_CustomValues.aspx", "CheckBoxList_CustomValues.aspx");
}
[Test]
@@ -155,6 +157,20 @@ namespace MonoTests.System.Web.UI.WebControls {
Assert.AreEqual (null, c.DoGetItemStyle (ListItemType.Item, 0), "GetItemStyle");
}
[Test]
[Category("NunitWeb")]
public void CheckBoxList_CustomValues(){
WebTest t = new WebTest("CheckBoxList_CustomValues.aspx");
string html = t.Run();
FormRequest f = new FormRequest(t.Response, "form1");
f.Controls.Add ("checkBoxList$1");
f.Controls ["checkBoxList$1"].Value = "val2";
t.Request = f;
html = t.Run();
Regex countchecked = new Regex("<input[^>]*checked=\"checked\"[^>]*>");
Assert.AreEqual(1, countchecked.Matches(html).Count);
}
[Test]
public void CheckBoxList_Bug377703_1 ()
{
@@ -169,8 +185,7 @@ namespace MonoTests.System.Web.UI.WebControls {
FormRequest fr = new FormRequest (t.Response, "form1");
fr.Controls.Add ("cbxl1$0");
fr.Controls ["cbxl1$0"].Value = "on";
fr.Controls ["cbxl1$0"].Value = "x";
fr.Controls.Add ("ctl01");
fr.Controls ["ctl01"].Value = "Click me twice to have the first Item become empty";
@@ -179,8 +194,7 @@ namespace MonoTests.System.Web.UI.WebControls {
fr = new FormRequest (t.Response, "form1");
fr.Controls.Add ("cbxl1$0");
fr.Controls ["cbxl1$0"].Value = "on";
fr.Controls ["cbxl1$0"].Value = "x";
fr.Controls.Add ("ctl01");
fr.Controls ["ctl01"].Value = "Click me twice to have the first Item become empty";
@@ -220,11 +234,9 @@ namespace MonoTests.System.Web.UI.WebControls {
FormRequest fr = new FormRequest (t.Response, "form1");
fr.Controls.Add ("cbxl2$0");
fr.Controls ["cbxl2$0"].Value = "on";
fr.Controls ["cbxl2$0"].Value = "x";
fr.Controls.Add ("cbxl2$2");
fr.Controls ["cbxl2$2"].Value = "on";
fr.Controls ["cbxl2$2"].Value = "z";
fr.Controls.Add ("ctl01");
fr.Controls ["ctl01"].Value = "Click to toggle enable status above";
@@ -305,14 +317,13 @@ namespace MonoTests.System.Web.UI.WebControls {
fr = new FormRequest (t.Response, "form1");
fr.Controls.Add ("checkBoxList$0");
fr.Controls ["checkBoxList$0"].Value = "on";
fr.Controls ["checkBoxList$0"].Value = "Item 1";
fr.Controls.Add ("checkBoxList$1");
fr.Controls ["checkBoxList$1"].Value = "on";
fr.Controls ["checkBoxList$1"].Value = "Item 2";
fr.Controls.Add ("checkBoxList$2");
fr.Controls ["checkBoxList$2"].Value = "on";
fr.Controls ["checkBoxList$2"].Value = "Item 3";
fr.Controls.Add ("checkBoxList$3");
fr.Controls ["checkBoxList$3"].Value = "on";
fr.Controls ["checkBoxList$3"].Value = "Item 4";
t.Request = fr;
html = t.Run ();
listHtml = HtmlDiff.GetControlFromPageHtml (html);

View File

@@ -145,7 +145,7 @@ namespace MonoTests.System.Web.UI.WebControls
}
[Test]
[ExpectedException(typeof(Exception))]
[ExpectedException(typeof(ArgumentException))]
public void MalformatTest5 ()
{
WebColorConverter conv;

View File

@@ -75,7 +75,7 @@ namespace MonoTests.System.Web.UI
Assert.AreEqual (0, cvt.ConvertFrom (null, null, String.Empty), "#A1-2");
Assert.AreEqual (0, cvt.ConvertFrom (null, null, "infinite"), "#A1-3");
Assert.AreEqual (0, cvt.ConvertFrom (null, null, "INfINiTE"), "#A1-4");
Assert.Throws<Exception> (() => {
Assert.Throws<ArgumentException> (() => {
cvt.ConvertFrom (null, null, "dummy");
}, "#A1-5");
Assert.AreEqual (5, cvt.ConvertFrom (null, null, "5"), "#A1-6");

View File

@@ -0,0 +1,18 @@
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Value attribute on items</title>
</head>
<body>
<form id="form1" runat="server" method="post">
<%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %>
<asp:CheckBoxList id="checkBoxList" runat="server">
<asp:ListItem Value="val1" Selected="true">Text1</asp:ListItem>
<asp:ListItem Value="val2">Text2</asp:ListItem>
<asp:ListItem Value="val3" Selected="true">Text3</asp:ListItem>
</asp:CheckBoxList>
<%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
</form>
</body>
</html>