Author: rolf
Date: 2007-07-20 12:23:29 -0400 (Fri, 20 Jul 2007)
New Revision: 82366

Modified:
   trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormHandleTest.cs
   trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs
Log:
* FormHandleTest.cs: Make a couple of classes public, so that other
  tests can use them.
* FormTest.cs: Added tests for #81969.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2007-07-20 16:15:07 UTC (rev 82365)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2007-07-20 16:23:29 UTC (rev 82366)
@@ -1,5 +1,11 @@
 2007-07-20  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
 
+       * FormHandleTest.cs: Make a couple of classes public, so that other
+         tests can use them.
+       * FormTest.cs: Added tests for #81969.
+
+2007-07-20  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
+
        * ComboBoxTests.cs, ComboBoxTest.cs: Unified ComboBoxTest.cs and
          ComboBoxTests.cs, deleted ComboBoxTests.cs
 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormHandleTest.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormHandleTest.cs
   2007-07-20 16:15:07 UTC (rev 82365)
+++ 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormHandleTest.cs
   2007-07-20 16:23:29 UTC (rev 82366)
@@ -900,7 +900,7 @@
                        c.Invoke (new InvokeDelegate (InvokeMethod));
                }
 
-               private class ProtectedPropertyForm : Form
+               public class ProtectedPropertyForm : Form
                {
 #if NET_2_0
                        public SizeF PublicAutoScaleFactor { get { return 
base.AutoScaleFactor; } } 
@@ -1163,7 +1163,7 @@
                        c.Dispose ();
                }
 
-               private class ProtectedMethodsForm : Form
+               public class ProtectedMethodsForm : Form
                {
                        public void PublicAccessibilityNotifyClients 
(AccessibleEvents accEvent, int childID) { base.AccessibilityNotifyClients 
(accEvent, childID); }
                        public void PublicActivateMdiChild (Form form) { 
base.ActivateMdiChild (form); }

Modified: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs 
2007-07-20 16:15:07 UTC (rev 82365)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs 
2007-07-20 16:23:29 UTC (rev 82366)
@@ -23,7 +23,80 @@
        [TestFixture]
        public class FormTest
        {
+               [Test] // bug 81969
+               public void StartPositionClosedForm ()
+               {
+                       using (Form form = new Form ()) {
+                               form.StartPosition = 
FormStartPosition.CenterParent;
+                               form.Load += new EventHandler 
(CenterDisposedForm_Load);
+                               form.Show ();
+                       }
+
+                       using (Form form = new Form ()) {
+                               form.StartPosition = 
FormStartPosition.CenterScreen;
+                               form.Load += new EventHandler 
(CenterDisposedForm_Load);
+                               form.Show ();
+                       }
+
+
+                       using (Form form = new Form ()) {
+                               form.StartPosition = FormStartPosition.Manual;
+                               form.Load += new EventHandler 
(CenterDisposedForm_Load);
+                               form.Show ();
+                       }
+
+
+                       using (Form form = new Form ()) {
+                               form.StartPosition = 
FormStartPosition.WindowsDefaultBounds;
+                               form.Load += new EventHandler 
(CenterDisposedForm_Load);
+                               form.Show ();
+                       }
+
+                       using (Form form = new Form ()) {
+                               form.StartPosition = 
FormStartPosition.WindowsDefaultLocation;
+                               form.Load += new EventHandler 
(CenterDisposedForm_Load);
+                               form.Show ();
+                       }
+               }
+               
+               
+               [Test] 
+               [ExpectedException (typeof (ObjectDisposedException))]
+               public void CenterToParentDisposedForm ()
+               {
+                       using (FormHandleTest.ProtectedMethodsForm form = new 
FormHandleTest.ProtectedMethodsForm ()) {
+                               form.Dispose ();
+                               form.PublicCenterToParent ();
+                       }
+               }
+
                [Test]
+               [ExpectedException (typeof (ObjectDisposedException))]
+               public void CenterToScreenDisposedForm ()
+               {
+                       using (FormHandleTest.ProtectedMethodsForm form = new 
FormHandleTest.ProtectedMethodsForm ()) {
+                               form.Dispose ();
+                               form.PublicCenterToScreen ();
+                       }
+               }
+
+               [Test]
+               public void SetStartPositionDisposedForm ()
+               {
+                       using (FormHandleTest.ProtectedMethodsForm form = new 
FormHandleTest.ProtectedMethodsForm ()) {
+                               form.Dispose ();
+                               form.StartPosition = 
FormStartPosition.WindowsDefaultLocation;
+                       }
+               }
+
+               private void CenterDisposedForm_Load (object sender, EventArgs 
e)
+               {
+                       ((Form) sender).Close ();
+               }
+               
+               
+               
+               [Test]
                public void ShowDialogCloseTest ()
                {
                        using (TimeBombedForm f = new TimeBombedForm ()) {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to