Bug 447851

Summary: Make all provider tests pass
Product: [Mono] UI Automation Reporter: Brad Taylor <btaylor1>
Component: Winforms - UIAAssignee: Mario Carrion <mcarrion>
Status: RESOLVED FIXED QA Contact: E-mail List <mono-a11y-qa>
Severity: Major    
Priority: P3 - Medium    
Version: Release 1.0   
Target Milestone: Release 1.0   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on: 435988, 455950    
Bug Blocks: 447852    
Attachments: Tested SplitContainer.
Tested Splitter.
Tests output.
Printers example

Description Brad Taylor 2008-11-21 21:47:02 UTC
Some time needs to be spent to make all the provider tests pass.
Comment 1 Mario Carrion 2008-12-10 21:55:10 UTC
I've committed a patch (UIAutomationWinforms-trunk r121259) to fix the tests  to pass, however some of them are not passing. Notice that you will need to apply the patches in Bug #435988 and Bug #455950 to get the following output:

Tests run: 524, Failures: 5, Not run: 176, Time: 119.525 seconds

Test Case Failures:
1) MonoTests.Mono.UIAutomation.Winforms.RadioButtonProviderTest.ElementSelectedEventTest : Not implemented
at MonoTests.Mono.UIAutomation.Winforms.RadioButtonProviderTest.ElementSelectedEventTest () [0x00000] in /home/mario/repository/mcarrion/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/AssemblyInfo.cs:1
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00057] in /home/mario/repository/mcarrion/mcs/class/corlib/System.Reflection/MonoMethod.cs:159

2) MonoTests.Mono.UIAutomation.Winforms.StatusStripProviderTest.NavigationTest :   We shouldn't have a child
  Expected: null
  But was:  <Mono.UIAutomation.Winforms.ToolStripLabelProvider>

at MonoTests.Mono.UIAutomation.Winforms.StatusStripProviderTest.NavigationTest () [0x000ea] in /home/mario/repository/mcarrion/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/StatusStripProviderTest.cs:220
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00057] in /home/mario/repository/mcarrion/mcs/class/corlib/System.Reflection/MonoMethod.cs:159

3) MonoTests.Mono.UIAutomation.Winforms.TextRangeProviderTest.FindAttribute : System.NullReferenceException : Object reference not set to an instance of an object
at MonoTests.Mono.UIAutomation.Winforms.TextRangeProviderTest.FindAttribute () [0x00044] in /home/mario/repository/mcarrion/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/TextRangeProviderTest.cs:1048
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00057] in /home/mario/repository/mcarrion/mcs/class/corlib/System.Reflection/MonoMethod.cs:159

4) MonoTests.Mono.UIAutomation.Winforms.TextRangeProviderTest.GetAttributeValue :   Expected string length 5 but was 10. Strings differ at index 1.
  Expected: "Arial"
  But was:  "Albany AMT"
  ------------^

at MonoTests.Mono.UIAutomation.Winforms.TextRangeProviderTest.GetAttributeValue () [0x0007e] in /home/mario/repository/mcarrion/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/TextRangeProviderTest.cs:1034
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00057] in /home/mario/repository/mcarrion/mcs/class/corlib/System.Reflection/MonoMethod.cs:159

5) MonoTests.Mono.UIAutomation.Winforms.TextRangeProviderTest.RichTextBoxFindAttribute : System.NullReferenceException : Object reference not set to an instance of an object
at MonoTests.Mono.UIAutomation.Winforms.TextRangeProviderTest.RichTextBoxFindAttribute () [0x000b7] in /home/mario/repository/mcarrion/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/TextRangeProviderTest.cs:1076
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00057] in /home/mario/repository/mcarrion/mcs/class/corlib/System.Reflection/MonoMethod.cs:159

Comment 2 Mario Carrion 2008-12-12 01:31:56 UTC
Hours updated. 1 test is failing. 

Need to write "children added before parent test"
Comment 3 Mario Carrion 2008-12-15 21:06:36 UTC
Test are passing, however I can't close this until all dependencies are marked as FIXED. r121545
Comment 4 Sanford Armstrong 2008-12-15 21:39:36 UTC
I'm removing the dependency on bug #446783, since the test has been modified to pass without any dependency on a fix for that bug.

As for the other dependencies...are the tests passing without having those patches applied?
Comment 5 Mario Carrion 2008-12-15 23:06:55 UTC
I don't get any failures when patches applied. Removing the patches I get:

Test Case Failures:
1) MonoTests.Mono.UIAutomation.Winforms.ToolBarProviderTest.NavigationTest :   We must have a child
  Expected: not null
  But was:  null

at MonoTests.Mono.UIAutomation.Winforms.ToolBarProviderTest.NavigationTest () [0x00063] in /home/mario/repository/mcarrion/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ToolBarProviderTest.cs:84
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00057] in /home/mario/repository/mcarrion/mcs/class/corlib/System.Reflection/MonoMethod.cs:159

2) MonoTests.Mono.UIAutomation.Winforms.ToolBarProviderTest.ToolBarButtonBasicPropertiesTest : System.NullReferenceException : Object reference not set to an instance of an object
at MonoTests.Mono.UIAutomation.Winforms.TestHelper.TestAutomationProperty (IRawElementProviderSimple provider, System.Windows.Automation.AutomationProperty property, System.Object expectedValue) [0x00000] in /home/mario/repository/mcarrion/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/TestHelper.cs:95
at MonoTests.Mono.UIAutomation.Winforms.BaseProviderTest.TestProperty (IRawElementProviderSimple provider, System.Windows.Automation.AutomationProperty property, System.Object expectedValue) [0x00000] in /home/mario/repository/mcarrion/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/BaseProviderTest.cs:329
at MonoTests.Mono.UIAutomation.Winforms.ToolBarProviderTest.ToolBarButtonBasicPropertiesTest () [0x0002c] in /home/mario/repository/mcarrion/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ToolBarProviderTest.cs:118
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00057] in /home/mario/repository/mcarrion/mcs/class/corlib/System.Reflection/MonoMethod.cs:159

3) MonoTests.Mono.UIAutomation.Winforms.ToolBarProviderTest.ToolBarButtonProviderPatternTest : System.NullReferenceException : Object reference not set to an instance of an object
at MonoTests.Mono.UIAutomation.Winforms.ToolBarProviderTest.ToolBarButtonProviderPatternTest () [0x0002c] in /home/mario/repository/mcarrion/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ToolBarProviderTest.cs:144
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00057] in /home/mario/repository/mcarrion/mcs/class/corlib/System.Reflection/MonoMethod.cs:159

The patch in bug #455950 is a dependency, and the patch in Bug #435988 is not tested, so we need to add a new test.
Comment 6 Mario Carrion 2008-12-31 18:47:22 UTC
Hey Neville we are getting failures when running your tests: PrintPreviewControlProvider and SplitContainerProvider, seems that you removed some patterns and you didn't update your tests. 

Can you update them?
Comment 7 Neville Gao 2009-01-04 10:49:31 UTC
Created attachment 263104 [details]
Tested SplitContainer.

PrintPreviewControl needs to load a doc to support IScrollProvider, will we need to upload one to UIAutomationWinformsTest dir?

Splitter also needs to update.
Comment 8 Mario Carrion 2009-01-05 11:49:46 UTC
(In reply to comment #7 from Neville Gao)
> Created an attachment (id=263104) [details]
> Tested SplitContainer.
OK to commit.
Comment 9 Neville Gao 2009-01-06 09:18:06 UTC
Committed in r122524.
Comment 10 Neville Gao 2009-01-06 09:52:14 UTC
Created attachment 263332 [details]
Tested Splitter.
Comment 11 Mario Carrion 2009-01-07 05:28:35 UTC
(In reply to comment #10 from Neville Gao)
> Created an attachment (id=263332) [details]
> Tested Splitter.
OK to commit.
Comment 12 Neville Gao 2009-01-07 06:35:50 UTC
Committed in r122620.
Comment 13 Mario Carrion 2009-01-22 17:13:46 UTC
Created attachment 266959 [details]
Tests output.

Tests run: 2633, Failures: 11, Not run: 98, Time: 285.426 seconds

Neville:
Can you update your tests (PrintPreviewControlroviderTest and PrintPreviewControlroviderTest) to close this bug?
Comment 14 Neville Gao 2009-01-23 05:58:19 UTC
There is another issue. Unit test should be run on a platform that installs printers, or an error messagebox says: No Pinrters Installed, and the test will not pass.
Comment 15 Mario Carrion 2009-01-23 15:14:35 UTC
Created attachment 267281 [details]
Printers example

Neville:

This example will work for your test. If you are missing CUPS the following message will print:

"libcups not found. To have printing support, you need cups installed"

so, you will need to install cups-devel (and maybe libgnomecups-devel?) and rebuild libgdiplus.

I guess using "System.Drawing.Printing.PrinterSettings.InstalledPrinters.Count > 0" will be better.
Comment 16 Mario Carrion 2009-01-28 16:40:10 UTC
With my recent change: 
http://lists.ximian.com/pipermail/mono-patches/2009-January/139603.html

I get the following output:
Tests run: 2636, Failures: 20, Not run: 97, Time: 778.402 seconds
http://paste2.org/p/137460

Basically the new failing tests are:

- HelpProviderTest.FragmentRootAsParentTest
- ToolStripButtonProviderTest.FragmentRootAsParentTest
- ToolStripDropDownButtonProviderTest.FragmentRootAsParentTest
- ToolStripDropDownButtonProviderTest.IsKeyboardFocusablePropertyTestForChildren
- ToolStripLabelProviderTest.FragmentRootAsParentTest
- ToolStripMenuItemProviderTest.FragmentRootAsParentTest
- ToolStripSeparatorProviderTest.FragmentRootAsParentTest 
- ToolStripSeparatorProviderTest.IsContentElementPropertyTest
- ToolStripSplitButtonProviderTest.FragmentRootAsParentTest
Comment 17 Mario Carrion 2009-01-29 00:50:12 UTC
Hello people, 

I'm happy to announce we have 0 failing tests:

http://paste2.org/p/137727

However, there are some [Ignore]d tests and I've disabled PrintPreviewControlroviderTest, in the meantime all our tests are passing. Congratulations!
Comment 18 Brad Taylor 2009-01-30 14:24:39 UTC
Mario, since you've hit 0, do you want to close this bug?  I figure the PrintPreviewControlProviderTest issue will be fixed in the PrintPreview enhancement that already exists.
Comment 19 Mario Carrion 2009-01-30 15:09:34 UTC
Sure.

Closing!.