Author: hdu
Date: Thu Feb 23 14:22:12 2012
New Revision: 1292812

URL: http://svn.apache.org/viewvc?rev=1292812&view=rev
Log:
([email protected]) Prepare automated testing using the Java GUI Test 
Tool

Modified:
    incubator/ooo/trunk/main/automation/source/inc/rcontrol.hxx
    incubator/ooo/trunk/main/automation/source/server/server.cxx
    incubator/ooo/trunk/main/automation/source/server/statemnt.cxx

Modified: incubator/ooo/trunk/main/automation/source/inc/rcontrol.hxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/automation/source/inc/rcontrol.hxx?rev=1292812&r1=1292811&r2=1292812&view=diff
==============================================================================
--- incubator/ooo/trunk/main/automation/source/inc/rcontrol.hxx (original)
+++ incubator/ooo/trunk/main/automation/source/inc/rcontrol.hxx Thu Feb 23 
14:22:12 2012
@@ -288,6 +288,14 @@
 //#define M_SOFFICE           0x0800  // Command valid for Star/Open Office
 //#define M_MOZILLA           0x1000  // Command valid for Mozilla
 
+// Enhencement
+#define M_GetHelpText  ( M_WITH_RETURN |  90 )
+#define M_GetQuickHelpText  ( M_WITH_RETURN |  91 )
+#define M_GetScreenRectangle ( M_WITH_RETURN |  92 )
+#define M_HasFocus ( M_WITH_RETURN |  93 )
+#define M_GetItemHelpText ( M_WITH_RETURN |  94 )
+#define M_GetItemQuickHelpText ( M_WITH_RETURN |  95 )
+#define M_GetItemText2 ( M_WITH_RETURN |  96 )
 
 // RemoteCommands
 #define RC_AppAbort                    ( M_SOFFICE | M_MOZILLA | 1 )

Modified: incubator/ooo/trunk/main/automation/source/server/server.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/automation/source/server/server.cxx?rev=1292812&r1=1292811&r2=1292812&view=diff
==============================================================================
--- incubator/ooo/trunk/main/automation/source/server/server.cxx (original)
+++ incubator/ooo/trunk/main/automation/source/server/server.cxx Thu Feb 23 
14:22:12 2012
@@ -187,7 +187,20 @@ sal_uLong RemoteControlCommunicationMana
                 break;
             }
         }
-
+       // Get port from command line
+       if (bAutomate) 
+       {
+               for ( i = 0 ; i < Application::GetCommandLineParamCount() ; i++ 
)
+               {
+                       if ( Application::GetCommandLineParam( i 
).Copy(0,16).EqualsIgnoreCaseAscii("/automationport=") 
+                               || Application::GetCommandLineParam( i 
).Copy(0,16).EqualsIgnoreCaseAscii("-automationport="))
+                       {
+                               nPortIs = Application::GetCommandLineParam( i 
).Copy(16).ToInt32();
+                               return nPortIs;
+                       }
+               }
+       }
+       //
 // if started within Portal determin location of testtool.ini/rc by analysing 
the commandline
 // /userid:demo1[/export/home/user/demo1]
 // -userid:demo1[/export/home/user/demo1]

Modified: incubator/ooo/trunk/main/automation/source/server/statemnt.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/automation/source/server/statemnt.cxx?rev=1292812&r1=1292811&r2=1292812&view=diff
==============================================================================
--- incubator/ooo/trunk/main/automation/source/server/statemnt.cxx (original)
+++ incubator/ooo/trunk/main/automation/source/server/statemnt.cxx Thu Feb 23 
14:22:12 2012
@@ -3955,6 +3955,32 @@ sal_Bool StatementControl::HandleVisible
                                        ValueOK(aUId, MethodString( nMethodId 
),nNr1,CountWinByRT( pControl, WINDOW_FIXEDTEXT, sal_True ) );
             }
                        break;
+               case M_HasFocus:
+                       {
+                               pRet->GenReturn ( RET_Value, aUId, 
pControl->HasFocus() );
+                       break;
+                       }
+               case M_GetScreenRectangle:
+                       {
+                               Rectangle aRect =  bBool1 ? 
pControl->GetClientWindowExtentsRelative(NULL) : 
pControl->GetWindowExtentsRelative( NULL );
+                pRet->GenReturn ( RET_Value, aUId, 
+                                       
UniString::CreateFromInt32(aRect.Left()).
+                                       
AppendAscii(",").Append(UniString::CreateFromInt32(aRect.Top())).
+                                       
AppendAscii(",").Append(UniString::CreateFromInt32(aRect.GetWidth())).
+                                       
AppendAscii(",").Append(UniString::CreateFromInt32(aRect.GetHeight()))
+                                       );
+                       }
+                       break;
+               case M_GetHelpText:
+                       {
+                               pRet->GenReturn ( RET_Value, aUId, 
pControl->GetHelpText());
+                       }
+                       break;
+               case M_GetQuickHelpText:
+                       {
+                               pRet->GenReturn ( RET_Value, 
aUId,pControl->GetQuickHelpText());
+                       }
+                       break;
                default:
                        return sal_False;
                }
@@ -5422,6 +5448,24 @@ sal_Bool StatementControl::Execute()
                                                                            
case 3:
                                                                                
    pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTB->GetItemId(nItemPos));
                                                                                
    break;
+                                                                               
        case 11:
+                                                                               
                pRet->GenReturn ( RET_Value, aUId, (comm_ULONG) nItemPos + 1);
+                                                                               
                break;
+                                                                               
        case 12:
+                                                                               
                pRet->GenReturn ( RET_Value, aUId, Id2Str(pTB->GetHelpId())); 
// The toolbox's help id
+                                                                               
                break;
+                                                                               
        case 13:
+                                                                               
        {
+                                                                               
                Rectangle aRect = pTB->GetItemPosRect( nItemPos );
+                                                                               
                Rectangle aTBRect = pTB->GetWindowExtentsRelative( NULL );
+                                                                               
                pRet->GenReturn ( RET_Value, aUId, 
+                                                                               
                UniString::CreateFromInt32(aRect.Left()+aTBRect.Left()).
+                                                                               
                        
AppendAscii(",").Append(UniString::CreateFromInt32(aRect.Top()+aTBRect.Top())).
+                                                                               
                        
AppendAscii(",").Append(UniString::CreateFromInt32(aRect.GetWidth())).
+                                                                               
                        
AppendAscii(",").Append(UniString::CreateFromInt32(aRect.GetHeight()))
+                                                                               
                );
+                                                                               
                break;
+                                                                               
        }
                                                                            
default:
                                                                                
    ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId 
) ) );
                                                 pRet->GenReturn ( RET_Value, 
aUId, comm_ULONG(0));
@@ -5430,6 +5474,18 @@ sal_Bool StatementControl::Execute()
                                                                        }
                                                                }
                                                                break;
+                                                       case M_GetItemHelpText :
+                                                               if ( ValueOK( 
aUId, MethodString( nMethodId ), nNr1, pTB->GetItemCount() ))
+                                                                       
pRet->GenReturn ( RET_Value, aUId, 
(String)pTB->GetHelpText(pTB->GetItemId(nNr1-1)));
+                                                               break;
+                                                       case 
M_GetItemQuickHelpText :
+                                                               if ( ValueOK( 
aUId, MethodString( nMethodId ), nNr1, pTB->GetItemCount() ))
+                                                                       
pRet->GenReturn ( RET_Value, aUId, 
(String)pTB->GetQuickHelpText(pTB->GetItemId(nNr1-1)));
+                                                               break;
+                                                       case M_GetItemText2:
+                                                               if ( ValueOK( 
aUId, MethodString( nMethodId ), nNr1, pTB->GetItemCount() ))
+                                                                       
pRet->GenReturn ( RET_Value, aUId, 
(String)pTB->GetItemText(pTB->GetItemId(nNr1-1)));
+                                                               break;
                                                        case M_GetItemText :
                                                                pRet->GenReturn 
( RET_Value, aUId, (String)pTB->GetItemText(nNr1));
                                                                break;


Reply via email to