diff options
Diffstat (limited to 'qadevOOo/tests/basic/ifc/accessibility')
24 files changed, 2035 insertions, 0 deletions
diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessible/accessibility_XAccessible.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessible/accessibility_XAccessible.xba new file mode 100644 index 000000000000..cf0ad56258e3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessible/accessibility_XAccessible.xba @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessible" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2008 by Sun Microsystems, Inc. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' $RCSfile: accessibility_XAccessible.xba,v $ +' +' $Revision: 1.3 $ +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessible +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim ac As Variant + + Test.StartMethod("getAccessibleContext()") + bOK = true + ac = oObj.getAccessibleContext() + bOK = bOK AND NOT isNull(ac) + Test.MethodTested("getAccessibleContext()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessible/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessible/script.xlb new file mode 100644 index 000000000000..acd98036701d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessible/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="accessibility_XAccessible" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessible"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleAction/accessibility_XAccessibleAction.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleAction/accessibility_XAccessibleAction.xba new file mode 100644 index 000000000000..9f3776d27b26 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleAction/accessibility_XAccessibleAction.xba @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleAction" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2008 by Sun Microsystems, Inc. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' $RCSfile: accessibility_XAccessibleAction.xba,v $ +' +' $Revision: 1.4 $ +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleAction +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getAccessibleActionCount()") + Dim count As Long + bOK = true + count = oObj.getAccessibleActionCount() + bOK = bOK AND (count > 0) + Test.MethodTested("getAccessibleActionCount()",bOK) + + Test.StartMethod("getAccessibleActionDescription()") + Dim i As Long + Dim desc As String + bOK = true + i = 0 + while ( i < count) + desc = oObj.getAccessibleActionDescription(i) + Out.Log("Found action "+i+": "+desc) + bOK = bOK AND NOT isNull(desc) + i = i + 1 + wend + Test.MethodTested("getAccessibleActionDescription()",bOK) + + Test.StartMethod("getAccessibleActionKeyBinding()") + Dim key As Variant + bOK = true + i = 0 + while ( i < count) + key = oObj.getAccessibleActionKeyBinding(i) + if not isNull(key) then + out.Log("Found key in " + i) + end if + i = i + 1 + wend + Test.MethodTested("getAccessibleActionKeyBinding()",bOK) + + Test.StartMethod("doAccessibleAction()") + bOK = true + bOK = bOK AND oObj.doAccessibleAction(0) + Test.MethodTested("doAccessibleAction()",bOK) + + 'This delay is REQUIRED here to avoid soffice blocking + wait(1000) + ReCreateObj() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleAction/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleAction/script.xlb new file mode 100644 index 000000000000..87edd989cbaa --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleAction/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="accessibility_XAccessibleAction" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleAction"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleComponent/accessibility_XAccessibleComponent.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleComponent/accessibility_XAccessibleComponent.xba new file mode 100644 index 000000000000..1e3814bdb332 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleComponent/accessibility_XAccessibleComponent.xba @@ -0,0 +1,251 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleComponent" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2008 by Sun Microsystems, Inc. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' $RCSfile: accessibility_XAccessibleComponent.xba,v $ +' +' $Revision: 1.3 $ +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleComponent +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getBounds()") + Dim bounds As new com.sun.star.awt.Rectangle + Dim X1,Y1 As Integer + bOK = true + bounds = oObj.getBounds() + X1 = bounds.X+bounds.Width + Y1 = bounds.Y+bounds.Height + Out.Log("Object's bounding box: ("+bounds.X+","+bounds.Y+","+X1+","+Y1+").") + bOK = bOK AND (NOT isNull(bounds)) AND (bounds.X >= 0) AND (bounds.Y >= 0) _ + AND (bounds.Width > 0) AND (bounds.Height > 0) + Test.MethodTested("getBounds()",bOK) + + Test.StartMethod("contains()") + Dim point1 As new com.sun.star.awt.Point + Dim point2 As new com.sun.star.awt.Point + bOK = true + point1.X = bounds.Width + 1 + point1.Y = bounds.Height + 1 + point2.X = 0 + point2.Y = 0 + bOK = bOK AND (NOT oObj.contains(point1)) AND oObj.contains(point2) + Test.MethodTested("contains()",bOK) + + Test.StartMethod("getAccessibleAt()") + Dim accAt As Object, oChild As Object + Dim i As Integer, childCount As Long, mCount As Integer + Dim chBounds As new com.sun.star.awt.Rectangle + Dim locRes As Boolean + Dim ComponentFound As Boolean + Dim visibleFound as Boolean + Dim XAccessibleSelection as Boolean + + bOK = true + childCount = oObj.getAccessibleChildCount() + if (childCount = 0) then + Out.Log("There are no children supported by XAccessibleComponent...") + else + Out.Log("There are "+childCount+" children supported by XAccessibleComponent.") + if (childCount > 50) then + mCount = 50 + Out.Log("Checking only first 50 children...") + else + mCount = childCount + End If + ComponentFound = false + visibleFound = false + XAccessibleSelection = hasUNOInterfaces(oObj, "drafts.com.sun.star.accessibility.XAccessibleSelection") + for i = 0 to (mCount - 1) + oChild = oObj.getAccessibleChild(i) + if NOT hasUNOInterfaces(oChild,"drafts.com.sun.star.accessibility.XAccessibleContext") then + oChild = oChild.getAccessibleContext() + End If + if hasUNOInterfaces(oChild,"drafts.com.sun.star.accessibility.XAccessibleComponent") then + ComponentFound = TRUE + if XAccessibleSelection then + if oObj.isAccessibleChildSelected(i) then + visibleFound = TRUE + End If + End If + oChild = oChild.getAccessibleContext() + chBounds = oChild.getBounds() + point1.X = chBounds.X + point1.Y = chBounds.Y + accAt = oObj.getAccessibleAt(point1) + locRes = utils.at_equals(accAt,oChild) + Out.log(" getAccessibleAt() with valid points with child " + i + ": " + locRes) + bOK = bOK AND locRes + point2.X = chBounds.X - 1 + point2.Y = chBounds.Y - 1 + accAt = oObj.getAccessibleAt(point2) + locRes = NOT utils.at_equals(accAt,oChild) + Out.log(" getAccessibleAt() with invalid points with child " + i + ": " + locRes) + bOK = bOK AND locRes + End If + next i + if not ComponentFound then + Out.Log("Could not find any children which supports XAccessibleComponent!") + bOK = TRUE + end if + if not visibleFound then + Out.Log("Could not find any children which is visible!") + bOK = TRUE + end if + End If + Test.MethodTested("getAccessibleAt()",bOK) + + Test.StartMethod("getLocation()") + bOK = true + point1 = oObj.getLocation() + bOK = bOK AND (point1.X = bounds.X) AND (point1.Y = bounds.Y) + Test.MethodTested("getLocation()",bOK) + + Test.StartMethod("getLocationOnScreen()") + Dim accParent As Object + bOK = true + accParent = getParentComponent() + point1 = oObj.getLocationOnScreen() + if NOT isNull(accParent) then + point2 = accParent.getLocationOnScreen() + bOK = bOK AND (point2.X + bounds.X = point1.X) + bOK = bOK AND (point2.Y + bounds.Y = point1.Y) + else + Out.Log("Component's parent is null.") + End If + Test.MethodTested("getLocationOnScreen()",bOK) + + Test.StartMethod("getSize()") + Dim oSize As new com.sun.star.awt.Size + bOK = true + oSize = oObj.getSize() + bOK = bOK AND (oSize.Width = bounds.Width) AND (oSize.Height = bounds.Height) + Test.MethodTested("getSize()",bOK) + + Test.StartMethod("grabFocus()") + bOK = true + oObj.grabFocus() + Test.MethodTested("grabFocus()",bOK) + + Test.StartMethod("getForeground()") + Dim fColor As Long + bOK = true + fColor = oObj.getForeground() + Out.Log("Foreground color is: "+fColor) + Test.MethodTested("getForeground()",bOK) + + Test.StartMethod("getBackground()") + Dim bColor As Long + bOK = true + bColor = oObj.getBackground() + Out.Log("Background color is: "+bColor) + Test.MethodTested("getBackground()",bOK) + + + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + + +Function getAccessibleChildren() As Variant + Dim accCount As Integer, i As Integer, j As Integer + Dim accChContext As Object, accCh As Object + Dim resArray(50) As Variant + Dim emptyArray() As Variant + j = 0 + i = 0 + if NOT hasUNOInterfaces(oObj,"drafts.com.sun.star.accessibility.XAccessible") then + Out.Log("An object does not support XAccessible interface!") + Exit Function + End If + accCount = oObj.getAccessibleChildCount() + if (accCount > 50) then accCount = 50 + while (i < accCount) + accCh = oObj.getAccessibleChild(i) + accChContext = accCh.getAccessibleContext() + if hasUNOInterfaces(accChContext,"drafts.com.sun.star.accessibility.XAccessibleComponent") then + resArray(j) = accChContext + j = j + 1 + End If + i = i + 1 + wend + if (accCount <> 0) then + Dim returnArray(j - 1) As Variant + For i = 0 to (j - 1) + returnArray(i) = resArray(i) + next i + getAccessibleChildren() = returnArray() + else + getAccessibleChildren() = emptyArray() + End If +End Function + +Function getParentComponent() As Object + Dim accParent As Object + Dim accParContext As Object + if NOT hasUNOInterfaces(oObj,"drafts.com.sun.star.accessibility.XAccessible") then + Out.Log("An object does not support XAccessible interface!") + Exit Function + End If + accParent = oObj.getAccessibleParent() + if isNull(accParent) then + Out.Log("The component has no accessible parent!") + Exit Function + End If + accParContext = accParent.getAccessibleContext() + if NOT hasUNOInterfaces(accParContext,"drafts.com.sun.star.accessibility.XAccessibleComponent") then + Out.Log("Accessible parent doesn't support XAccessibleComponent!") + Exit Function + else + getParentComponent() = accParContext + End If +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleComponent/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleComponent/script.xlb new file mode 100644 index 000000000000..a1c29c03c632 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleComponent/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="accessibility_XAccessibleComponent" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleComponent"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleContext/accessibility_XAccessibleContext.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleContext/accessibility_XAccessibleContext.xba new file mode 100644 index 000000000000..dc21f1791042 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleContext/accessibility_XAccessibleContext.xba @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleContext" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2008 by Sun Microsystems, Inc. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' $RCSfile: accessibility_XAccessibleContext.xba,v $ +' +' $Revision: 1.4 $ +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleContext +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim childCount As Long, i As Integer + Dim oParent As Object + + Test.StartMethod("getAccessibleChildCount()") + bOK = true + childCount = oObj.getAccessibleChildCount() + bOK = bOK AND (childCount > -1) + Test.MethodTested("getAccessibleChildCount()",bOK) + + + Test.StartMethod("getAccessibleChild()") + Dim childContext As Object + Dim mCount As Integer + bOK = true + i = 0 + if (childCount > 50) then + mCount = 50 + else + mCount = childCount + End If + while (i < mCount) + childContext = oObj.getAccessibleChild(i).getAccessibleContext() + Out.Log(" Child " + i + ": " + childContext.getAccessibleDescription()) + bOK = bOK AND utils.at_equals(childContext.getAccessibleParent(), oObj) + i = i + 1 + wend + Test.MethodTested("getAccessibleChild()",bOK) + + + Test.StartMethod("getAccessibleParent()") + bOK = true + oParent = oObj.getAccessibleParent() + bOK = bOK AND NOT isNull(oParent) + Test.MethodTested("getAccessibleParent()",bOK) + + + Test.StartMethod("getAccessibleIndexInParent()") + Dim idx As Integer + Dim parentAC As Object + bOK = true + idx = oObj.getAccessibleIndexInParent() + parentAC = oParent.getAccessibleContext() + bOK = bOK AND utils.at_equals(parentAC.getAccessibleChild(idx), oObj) + Test.MethodTested("getAccessibleIndexInParent()",bOK) + + + Test.StartMethod("getAccessibleRole()") + Dim role As Integer + bOK = true + role = oObj.getAccessibleRole() + Out.Log("The role is " + role) + bOK = bOK AND (role > -1) + Test.MethodTested("getAccessibleRole()",bOK) + + + Test.StartMethod("getAccessibleDescription()") + Dim descr As String + bOK = true + descr = oObj.getAccessibleDescription() + Out.Log("The description is " + descr) + bOK = bOK AND NOT isNull(descr) + Test.MethodTested("getAccessibleDescription()",bOK) + + + Test.StartMethod("getAccessibleName()") + Dim oName As String + bOK = true + oName = oObj.getAccessibleName() + Out.Log("The name is " + oName) + bOK = bOK AND NOT isNull(oName) + Test.MethodTested("getAccessibleName()",bOK) + + + Test.StartMethod("getAccessibleRelationSet()") + Dim oSet As Variant + bOK = true + oSet = oObj.getAccessibleRelationSet() + ' Relationset could be null + if not isNull(oSet) then + oSet.getRelationCount() + end if + Test.MethodTested("getAccessibleRelationSet()",bOK) + + + Test.StartMethod("getAccessibleStateSet()") + bOK = true + oSet = oObj.getAccessibleStateSet() + bOK = bOK AND NOT isNull(oSet) + if NOT bOK then Out.Log("This object does not support states") + Test.MethodTested("getAccessibleStateSet()",bOK) + + + Test.StartMethod("getLocale()") + Dim oLoc As Variant + bOK = true + oLoc = oObj.getLocale() + Out.Log("The locale is "+oLoc.Language+", "+oLoc.Country) + bOK = bOK AND NOT isNull(oLoc) AND (len(oLoc.Language) > 0) AND (len(oLoc.Country) > 0) + Test.MethodTested("getLocale()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleContext/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleContext/script.xlb new file mode 100644 index 000000000000..5e4280103263 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleContext/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="accessibility_XAccessibleContext" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleContext"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEditableText/accessibility_XAccessibleEditableText.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEditableText/accessibility_XAccessibleEditableText.xba new file mode 100644 index 000000000000..4ea99280d25c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEditableText/accessibility_XAccessibleEditableText.xba @@ -0,0 +1,185 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleEditableText" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2008 by Sun Microsystems, Inc. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' $RCSfile: accessibility_XAccessibleEditableText.xba,v $ +' +' $Revision: 1.4 $ +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' global hasChangeableAttrs as boolean + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleEditableText +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean, locRes As Boolean + Dim oldText As String, curText As String + Dim length As Integer, initialText As String + + oldText = oObj.getText() + initialText = oldText + length = oObj.getCharacterCount() + Out.Log("Text: "+oldText) + Out.Log("Length: "+length) + + + Test.StartMethod("cutText()") + bOK = true + locRes = oObj.cutText(0,length) + curText = oObj.getText() + bOK = bOK AND (len(curText) = 0) AND locRes + Test.MethodTested("cutText()",bOK) + + + Test.StartMethod("pasteText()") + bOK = true + locRes = oObj.pasteText(0) + curText = oObj.getText() + bOK = bOK AND (len(curText) = length) AND locRes + Test.MethodTested("pasteText()",bOK) + + + Test.StartMethod("insertText()") + Dim insString As String + bOK = true + insString = "Inserted String" + locRes = oObj.insertText(insString,length) + curText = oObj.getText() + bOK = bOK AND (curText = oldText + insString) AND locRes + Test.MethodTested("insertText()",bOK) + + + Test.StartMethod("deleteText()") + bOK = true + locRes = oObj.deleteText(len(curText) - len(insString),len(curText)) + curText = oObj.getText() + bOK = bOK AND (curText = oldText) AND locRes + Test.MethodTested("deleteText()",bOK) + + + Test.StartMethod("replaceText()") + Dim replacement As String + Dim endIndex As Integer + bOK = true + oObj.setText(oldText+"(part of string to replace)") + endIndex = len(oObj.getText) + replacement = "Replacement string" + locRes = oObj.replaceText(len(oldText),endIndex,replacement) + curText = oObj.getText() + bOK = bOK AND (curText = oldText + replacement) AND locRes + Test.MethodTested("replaceText()",bOK) + + + Test.StartMethod("setAttributes()") + if hasChangeableAttrs then + Dim attrs As Variant, newAttrs As Variant + Dim i As Integer + bOK = true + length = oObj.getCharacterCount() + attrs = oObj.getCharacterAttributes(0) + for i=0 to ubound(attrs()) + if attrs(i).Name = "CharBackColor" then attrs(i).Value = RGB(120,205,40) + if attrs(i).Name = "CharHeight" then attrs(i).Value = 30 + if attrs(i).Name = "CharColor" then attrs(i).Value = RGB(255,255,255) + next i + locRes = oObj.setAttributes(0,length,attrs) + bOK = bOK AND locRes + newAttrs = oObj.getCharacterAttributes(0) + bOK = bOK AND PropertyTester.equals(attrs,newAttrs) + else + Out.Log("Object has no changeable attributes.") + bOK = true + End If + Test.MethodTested("setAttributes()",bOK) + + + Test.StartMethod("setText()") + Dim newText As String + bOK = true + oldText = oObj.getText() + newText = "New string" + locRes = oObj.setText(newText) + curText = oObj.getText() + bOK = bOK AND (curText = newText) AND locRes + if locRes then + Out.Log("Test 1 passed OK.") + else + Out.Log("Test 1 failed.") + End If + newText = "" + locRes = oObj.setText(newText) + curText = oObj.getText() + bOK = bOK AND (newText = curText) AND locRes + if locRes then + Out.Log("Test 2 passed OK.") + else + Out.Log("Test 2 failed.") + End If + locRes = oObj.setText(oldText) + curText = oObj.getText() + bOK = bOK AND (curText = oldText) AND locRes + if locRes then + Out.Log("Test 3 passed OK.") + else + Out.Log("Test 3 failed.") + End If + Test.MethodTested("setText()",bOK) + + out.dbg("Setting initial text: " + initialText ) + oObj.setText(initialText) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEditableText/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEditableText/script.xlb new file mode 100644 index 000000000000..d2109838e813 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEditableText/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="accessibility_XAccessibleEditableText" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleEditableText"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEventBroadcaster/accessibility_XAccessibleEventBroadcaster.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEventBroadcaster/accessibility_XAccessibleEventBroadcaster.xba new file mode 100644 index 000000000000..e77dced7d457 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEventBroadcaster/accessibility_XAccessibleEventBroadcaster.xba @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleEventBroadcaster" script:language="StarBasic"> +'************************************************************************* +'* +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2008 by Sun Microsystems, Inc. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' $RCSfile: accessibility_XAccessibleEventBroadcaster.xba,v $ +' +' $Revision: 1.4 $ +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' fireEvent() precedure +' located in component test + +'************************************************************************* + + + + + +Dim oListener1 As Object +Dim oListener2 As Object +Dim bL1called As Boolean +Dim bL2called As Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleEventBroadcaster +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim isTransient As Boolean + Dim stateSet As Variant + bOK = true + + 'out.log("Creating Listeners...") + oListener1 = createUNOListener("EL1_","com.sun.star.accessibility.XAccessibleEventListener") + oListener2 = createUNOListener("EL2_","com.sun.star.accessibility.XAccessibleEventListener") + bOK = bOK AND NOT isNULL(oListener1) AND NOT isNULL(oListener2) + if NOT bOK then out.log( "ERROR: Cannot create listeners...") + + if NOT hasUNOInterfaces(oObj,"com.sun.star.accessibility.XAccessibleContext") then + 'out.log("Object does not implement XAccessibleContext.") + isTransient = false + else + stateSet = oObj.getAccessibleStateSet() + isTransient = stateSet.contains(27) + End If + + Test.StartMethod("addEventListener()") + bOK = true + bL1called = false + bL2called = false + 'out.log("Adding two listeners...") + oObj.com_sun_star_accessibility_XAccessibleEventBroadcaster_addEventListener(oListener1) + oObj.com_sun_star_accessibility_XAccessibleEventBroadcaster_addEventListener(oListener2) + 'out.log("fire event") + fireEvent() + wait(500) + out.log("Listener1 called: "+bL1called) + out.log("Listener2 called: "+bL2called) + if NOT isTransient then + bOK = bOK AND bL1called AND bL2called + else + 'out.log("Object is transient, listeners aren't expected to call.") + bOK = true + End If + Test.MethodTested("addEventListener()",bOK) + + + Test.StartMethod("removeEventListener()") + bOK = true + bL1called = false + bL2called = false + 'out.log("Removing one listener...") + oObj.com_sun_star_accessibility_XAccessibleEventBroadcaster_removeEventListener(oListener1) + 'out.log("fire event") + fireEvent() + wait(500) + out.log("Listener1 called: "+bL1called) + out.log("Listener2 called: "+bL2called) + if NOT isTransient then + bOK = bOK AND NOT bL1called AND bL2called + else + 'out.log("Object is transient, listeners aren't expected to call.") + bOK = true + End If + Test.MethodTested("removeEventListener()",bOK) + + ' Removing the second listener... + oObj.com_sun_star_accessibility_XAccessibleEventBroadcaster_removeEventListener(oListener2) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub EL1_notifyEvent(ev As Variant) + 'out.log("CallBack for Listener1 notifyEvent was called.") + bL1called = true +End Sub + +Sub EL1_disposing() +End Sub + +Sub EL2_notifyEvent(ev As Variant) + 'out.log("CallBack for Listener2 notifyEvent was called.") + bL2called = true +End Sub + +Sub EL2_disposing() +End Sub + +</script:module>
\ No newline at end of file diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEventBroadcaster/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEventBroadcaster/script.xlb new file mode 100644 index 000000000000..9a06ecd1c438 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEventBroadcaster/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="accessibility_XAccessibleEventBroadcaster" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleEventBroadcaster"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleExtendedComponent/accessibility_XAccessibleExtendedComponent.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleExtendedComponent/accessibility_XAccessibleExtendedComponent.xba new file mode 100644 index 000000000000..33dec4715629 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleExtendedComponent/accessibility_XAccessibleExtendedComponent.xba @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleExtendedComponent" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2008 by Sun Microsystems, Inc. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' $RCSfile: accessibility_XAccessibleExtendedComponent.xba,v $ +' +' $Revision: 1.4 $ +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleExtendedComponent +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getFont()") + Dim font As Variant + Dim fDescr As new com.sun.star.awt.FontDescriptor + bOK = true + font = oObj.getFont() + if NOT isNull(font) then + fDescr = font.getFontDescriptor() + Out.Log("Font: "+fDescr.Name) + else + Out.Log("Font: null") + End If + Test.MethodTested("getFont()",bOK) + + Test.StartMethod("getTitledBorderText()") + Dim tbText As String + bOK = true + tbText = oObj.getTitledBorderText() + Out.Log("TitledBorderText: "+tbText) + bOK = bOK AND NOT isNull(tbText) + Test.MethodTested("getTitledBorderText()",bOK) + + Test.StartMethod("getToolTipText()") + Dim ttText As String + bOK = true + ttText = oObj.getToolTipText() + Out.Log("TitledBorderText: "+ttText) + bOK = bOK AND NOT isNull(ttText) + Test.MethodTested("getToolTipText()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleExtendedComponent/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleExtendedComponent/script.xlb new file mode 100644 index 000000000000..de17e5c2c8c1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleExtendedComponent/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="accessibility_XAccessibleExtendedComponent" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleExtendedComponent"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleImage/accessibility_XAccessibleImage.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleImage/accessibility_XAccessibleImage.xba new file mode 100644 index 000000000000..57309d8d1396 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleImage/accessibility_XAccessibleImage.xba @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleImage" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2008 by Sun Microsystems, Inc. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' $RCSfile: accessibility_XAccessibleImage.xba,v $ +' +' $Revision: 1.3 $ +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleImage +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getAccessibleImageDescription()") + Dim descr As String + bOK = true + descr = oObj.getAccessibleImageDescription() + Out.Log("AccessibleImageDescription: "+descr) + bOK = bOK AND NOT isNull(descr) + Test.MethodTested("getAccessibleImageDescription()",bOK) + + Test.StartMethod("getAccessibleImageHeight()") + Dim height As Long + bOK = true + height = oObj.getAccessibleImageHeight() + Out.Log("AccessibleImageHeight: "+height) + Test.MethodTested("getAccessibleImageHeight()",bOK) + + Test.StartMethod("getAccessibleImageWidth()") + Dim width As Long + bOK = true + width = oObj.getAccessibleImageWidth() + Out.Log("AccessibleImageWidth: "+width) + Test.MethodTested("getAccessibleImageWidth()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleImage/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleImage/script.xlb new file mode 100644 index 000000000000..71df8d188c26 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleImage/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="accessibility_XAccessibleImage" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleImage"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleSelection/accessibility_XAccessibleSelection.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleSelection/accessibility_XAccessibleSelection.xba new file mode 100644 index 000000000000..9d012b5a9784 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleSelection/accessibility_XAccessibleSelection.xba @@ -0,0 +1,263 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleSelection" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2008 by Sun Microsystems, Inc. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' $RCSfile: accessibility_XAccessibleSelection.xba,v $ +' +' $Revision: 1.4 $ +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global multiSelection As Boolean + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleSelection +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean, locRes As Boolean + Dim chCount As Long, selCount As Long + Dim i As Long, mCount As Integer + + if multiSelection then + Out.Log("Object allows multiple selection!") + else + Out.Log("Object does not allow multiple selection!") + End If + + chCount = oObj.getAccessibleChildCount() + selCount = oObj.getSelectedAccessibleChildCount() + Out.Log("Object has "+chCount+" child(ren), "+selCount+" of them selected.") + If (chCount > 50) then + mCount = 50 + Out.Log("Object has too many children. Testing only first 50.") + else + mCount = chCount + End If + + clearSelection() + + Test.StartMethod("selectAccessibleChild()") + bOK = true + if (mCount > 0) then + i = mCount - 1 + while (oObj.isAccessibleChildSelected(i) OR itemDisabled(oObj.getAccessibleChild(i))) AND (i > 0) + i = i - 1 + wend + if (i >= 0) then + Out.Log("Selecting child #"+i+"...") + oObj.selectAccessibleChild(i) + wait(500) + locRes = oObj.isAccessibleChildSelected(i) + Out.Log("Child #"+i+" selected: "+locRes) + bOK = bOK AND locRes + End If + End If + clearSelection() + Test.MethodTested("selectAccessibleChild()",bOK) + + Test.StartMethod("isAccessibleChildSelected()") + bOK = true + if (mCount > 0) then + i = mCount - 1 + while (oObj.isAccessibleChildSelected(i) OR itemDisabled(oObj.getAccessibleChild(i))) AND (i > 0) + i = i - 1 + wend + if (i >= 0) then + Out.Log("Selecting child #"+i+"...") + oObj.selectAccessibleChild(i) + wait(500) + locRes = oObj.isAccessibleChildSelected(i) + Out.Log("Child #"+i+" selected: "+locRes) + bOK = bOK AND locRes + End If + End If + clearSelection() + Test.MethodTested("isAccessibleChildSelected()",bOK) + + Test.StartMethod("clearAccessibleSelection()") + bOK = true + if (mCount > 0) AND (multiSelection) then + oObj.selectAccessibleChild(chCount - 1) + wait(500) + oObj.clearAccessibleSelection() + wait(500) + bOK = bOK AND NOT oObj.isAccessibleChildSelected(mCount - 1) + else + Out.Log("Cannot clear all selection for this object!") + End If + Test.MethodTested("clearAccessibleSelection()",bOK) + +' ### The following property was not found in correspond IDL file! ### + Test.StartMethod("selectAllAccessibleChildren()") + bOK = true + i = 0 + if ((mCount > 0) AND multiSelection) then +' ### The following property was not found in correspond IDL file! ### + oObj.selectAllAccessibleChildren() + wait(500) + while (i < mCount) + bOK = bOK AND oObj.isAccessibleChildSelected(i) + i = i + 1 + wend + else + Out.Log("Cannot select all children for this object!") + End If + clearSelection() + Test.MethodTested("selectAllAccessibleChildren()",bOK) + + Test.StartMethod("getSelectedAccessibleChildCount()") + bOK = true + Out.Log("Selecting all...") + oObj.selectAllAccessibleChildren() + wait(500) + selCount = oObj.getSelectedAccessibleChildCount() + Out.Log("Selected "+selCount+" child(ren).") + If (multiSelection) then + bOK = bOK AND (selCount = chCount) + else + bOK = bOK AND (selCount = 1) + End If + clearSelection() + selCount = oObj.getSelectedAccessibleChildCount() + if (multiSelection) then + bOK = bOK AND (selCount = 0) + else + bOK = bOK AND (selCount = 1) + End If + Test.MethodTested("getSelectedAccessibleChildCount()",bOK) + + Test.StartMethod("getSelectedAccessibleChild()") + Dim selAccChild As Object, accChild As Object + bOK = true + if (mCount > 0) then + i = mCount - 1 + while (oObj.isAccessibleChildSelected(i) OR itemDisabled(oObj.getAccessibleChild(i))) AND (i > 0) + i = i - 1 + wend + if (i >= 0) then + Out.Log("Selecting child #"+i+"...") + oObj.selectAccessibleChild(i) + wait(500) + Out.Log("Child #"+i+" selected: "+oObj.isAccessibleChildSelected(i)) + Out.Log("Now "+oObj.getSelectedAccessibleChildCount()+" child(ren) selected.") + selCount = oObj.getSelectedAccessibleChildCount() + if (selCount > 0) then + selAccChild = oObj.getSelectedAccessibleChild(selCount-1) + accChild = oObj.getAccessibleChild(i) + bOK = bOK AND utils.at_equals(accChild,selAccChild) + else + Out.Log("There are no selected children. Test fails.") + bOK = false + End If + End If + End If + Test.MethodTested("getSelectedAccessibleChild()",bOK) + + Test.StartMethod("deselectAccessibleChild()") + Dim newSelCount As Long + Dim isSelected as Boolean + bOK = true + oObj.selectAllAccessibleChildren() + wait(500) + selCount = oObj.getSelectedAccessibleChildCount() + Out.Log("There was "+selCount+" selected child(ren)") + Out.Log("Deselecting child...") + for i = 0 to mCount - 1 + if oObj.isAccessibleChildSelected(i) then + isSelected = true + end if + oObj.deselectAccessibleChild(i) + wait(500) + newSelCount = oObj.getSelectedAccessibleChildCount() + Out.Log("selCount = " + selCount + " newSelCount = " + newSelCount) + if (multiSelection) then + if isSelected then + Out.Log("isSelected") + bOK = bOK AND (selCount - 1 = newSelCount) + else + bOK = bOK AND (selCount = newSelCount) + end if + else + Out.Log("is not multi") + bOK = bOK AND (newSelCount <= 1) + End If + selCount = newSelCount + next + Test.MethodTested("deselectAccessibleChild()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub clearSelection() + if NOT multiSelection then Exit Sub + Dim selCount As Long + selCount = oObj.getSelectedAccessibleChildCount() + if (selCount = 0) then Exit Sub + oObj.clearAccessibleSelection() + wait(500) + selCount = oObj.getSelectedAccessibleChildCount() + if selCount = 0 then + Out.Log("Deselect all: success") + else + Out.Log("Deselect all: error!. "+selCount+" child(ren) remains selected.") + End If +End Sub + +Function itemDisabled(oChild As Object) As Boolean + if NOT hasUNOInterfaces(oChild,"com.sun.star.accessibility.XAccessibleContext") then + oChild = oChild.getAccessibleContext() + End If + itemDisabled = NOT oChild.getAccessibleStateSet().contains(21) +End Function + +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleSelection/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleSelection/script.xlb new file mode 100644 index 000000000000..6f5d862cdcd3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleSelection/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="accessibility_XAccessibleSelection" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleSelection"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleTable/accessibility_XAccessibleTable.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleTable/accessibility_XAccessibleTable.xba new file mode 100644 index 000000000000..73c1d4037d51 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleTable/accessibility_XAccessibleTable.xba @@ -0,0 +1,295 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleTable" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2008 by Sun Microsystems, Inc. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' $RCSfile: accessibility_XAccessibleTable.xba,v $ +' +' $Revision: 1.3 $ +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleTable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim implSel As Boolean + + implSel = hasUNOInterfaces(oObj,"drafts.com.sun.star.accessibility.XAccessibleSelection") + if (NOT implSel) then + Out.Log("!!! The component doesn't implement the interface XAccessibleSelection.") + Out.Log("!!! This interface is required for more detailed tests.") + End If + + Test.StartMethod("getAccessibleRowCount()") + Dim rowCount As Long + bOK = true + rowCount = oObj.getAccessibleRowCount() + Out.Log("Accessible row count: "+rowCount) + Test.MethodTested("getAccessibleRowCount()",bOK) + + Test.StartMethod("getAccessibleColumnCount()") + Dim colCount As Long + bOK = true + colCount = oObj.getAccessibleColumnCount() + Out.Log("Accessible column count: "+colCount) + Test.MethodTested("getAccessibleColumnCount()",bOK) + + Test.StartMethod("getAccessibleRowDescription()") + Dim rowDescr As String + bOK = true + if (rowCount > 0) then + rowDescr = oObj.getAccessibleRowDescription(rowCount - 1) + Out.Log("Row "+(rowCount-1)+" description: "+rowDescr) + bOK = bOK AND NOT isNull(rowDescr) + else + Out.Log("!!! RowCount is 0. Could not test this method.") + End If + Test.MethodTested("getAccessibleRowDescription()",bOK) + + Test.StartMethod("getAccessibleColumnDescription()") + Dim colDescr As String + bOK = true + if (colCount > 0) then + colDescr = oObj.getAccessibleRowDescription(colCount - 1) + Out.Log("Column "+(colCount-1)+" description: "+colDescr) + bOK = bOK AND NOT isNull(colDescr) + else + Out.Log("!!! ColumnCount is 0. Could not test this method.") + End If + Test.MethodTested("getAccessibleColumnDescription()",bOK) + + Test.StartMethod("getAccessibleRowExtentAt()") + Dim ext As Long + bOK = true + ext = oObj.getAccessibleRowExtentAt(rowCount - 1, colCount - 1) + Out.Log(ext) + bOK = bOK AND (ext >= 1) + Test.MethodTested("getAccessibleRowExtentAt()",bOK) + + Test.StartMethod("getAccessibleColumnExtentAt()") + bOK = true + ext = oObj.getAccessibleColumnExtentAt(rowCount - 1, colCount - 1) + Out.Log(ext) + bOK = bOK AND (ext >= 1) + Test.MethodTested("getAccessibleColumnExtentAt()",bOK) + + Test.StartMethod("getAccessibleRowHeaders()") + Dim rowHeaders As Object + bOK = true + rowHeaders = oObj.getAccessibleRowHeaders() + bOK = bOK AND NOT isNull(rowHeaders) + Test.MethodTested("getAccessibleRowHeaders()",bOK) + + Test.StartMethod("getAccessibleColumnHeaders()") + Dim colHeaders As Object + bOK = true + colHeaders = oObj.getAccessibleColumnHeaders() + bOK = bOK AND NOT isNull(colHeaders) + Test.MethodTested("getAccessibleColumnHeaders()",bOK) + + Test.StartMethod("getSelectedAccessibleRows()") + Dim selRows As Variant + Dim elCount As Long, i As Integer + Dim locRes As Boolean + bOK = true + if implSel then + oObj.selectAllAccessible() + End If + selRows = oObj.getSelectedAccessibleRows() + elCount = ubound(selRows) - 1 + Out.Log("Returned sequence has "+elCount+" elements") + if implSel then + bOK = bOK AND (elCount = rowCount) + else + bOK = bOK AND (elCount = 0) + End If + if (elCount > 0) then + Out.Log("Checking that returned sequence is in ascending order") + End If + i = 1 + while (i < elCount) + locRes = (selRows(i) >= selRows(i-1)) + bOK = bOK AND locRes + if NOT locRes then + Out.Log("Element "+i+" : Returned sequence is not in accending order.") + break + End If + wend + Test.MethodTested("getSelectedAccessibleRows()",bOK) + + Test.StartMethod("getSelectedAccessibleColumns()") + Dim selCols As Variant + bOK = true + selCols = oObj.getSelectedAccessibleRows() + elCount = ubound(selCols) - 1 + Out.Log("Returned sequence has "+elCount+" elements") + if implSel then + bOK = bOK AND (elCount = colCount) + else + bOK = bOK AND (elCount = 0) + End If + if (elCount > 0) then + Out.Log("Checking that returned sequence is in ascending order") + End If + i = 1 + while (i < elCount) + locRes = (selCols(i) >= selCols(i-1)) + bOK = bOK AND locRes + if NOT locRes then + Out.Log("Element "+i+" : Returned sequence is not in accending order.") + break + End If + wend + Test.MethodTested("getSelectedAccessibleColumns()",bOK) + + Test.StartMethod("isAccessibleRowSelected()") + Dim mCount As Integer + bOK = true + locRes = true + if (rowCount > 299) then + mCount = 299 + else + mCount = rowCount - 1 + End If + for i=0 to mCount + locRes = oObj.isAccessibleRowSelected(i) + if implSel then + bOK = bOK AND locRes + else + bOK = bOK AND NOT locRes + End If + next i + Out.Log("Checked "+i+" of "+rowCount+" rows.") + Test.MethodTested("isAccessibleRowSelected()",bOK) + + Test.StartMethod("isAccessibleColumnSelected()") + bOK = true + locRes = true + if (colCount > 299) then + mCount = 299 + else + mCount = colCount - 1 + End If + for i=0 to mCount + locRes = oObj.isAccessibleColumnSelected(i) + if implSel then + bOK = bOK AND locRes + else + bOK = bOK AND NOT locRes + End If + next i + Out.Log("Checked "+i+" of "+colCount+" columns.") + Test.MethodTested("isAccessibleColumnSelected()",bOK) + + Test.StartMethod("getAccessibleCellAt()") + Dim xAccCell As Object + bOK = true + xAccCell = oObj.getAccessibleCellAt(rowCount - 1, colCount - 1) + bOK = bOK AND NOT isNull(xAccCell) + Test.MethodTested("getAccessibleCellAt()",bOK) + + Test.StartMethod("getAccessibleCaption()") + Dim caption As Object + bOK = true + caption = oObj.getAccessibleCaption() + Test.MethodTested("getAccessibleCaption()",bOK) + + Test.StartMethod("getAccessibleSummary()") + Dim summary As Object + bOK = true + summary = oObj.getAccessibleSummary() + Test.MethodTested("getAccessibleSummary()",bOK) + + Test.StartMethod("isAccessibleSelected()") + bOK = true + locRes = oObj.isAccessibleSelected(rowCount - 1, colCount - 1) + if implSel then + bOK = bOK AND locRes + else + bOK = bOK AND NOT locRes + End If + Test.MethodTested("isAccessibleSelected()",bOK) + + Test.StartMethod("getAccessibleIndex()") + Dim ind As Long, expIndex As Long + bOK = true + ind = oObj.getAccessibleIndex(rowCount - 1, colCount - 1) + Out.Log("AccessibleIndex is: "+ind) + if NOT isNull(xAccCell) then + expIndex = xAccCell.getAccessibleContext().getAccessibleIndexInParent() + Out.Log("Expected index is: "+expIndex) + bOK = bOK AND (ind = expIndex) + End If + Test.MethodTested("getAccessibleIndex()",bOK) + + Test.StartMethod("getAccessibleRow()") + Dim rowIndex As Long + Dim chCount As Long + bOK = true + if hasUNOInterfaces(oObj,"drafts.com.sun.star.accessibility.XAccessibleContext") then + chCount = oObj.getAccessibleChildCount() + rowIndex = oObj.getAccessibleRow(chCount - 1) + bOK = bOK AND (rowIndex >= 0) AND (rowIndex <= rowCount) + End If + rowIndex = oObj.getAccessibleRow(0) + bOK = bOK AND (rowIndex >= 0) AND (rowIndex <= rowCount) + Test.MethodTested("getAccessibleRow()",bOK) + + Test.StartMethod("getAccessibleColumn()") + Dim colIndex As Long + bOK = true + if hasUNOInterfaces(oObj,"drafts.com.sun.star.accessibility.XAccessibleContext") then + chCount = oObj.getAccessibleChildCount() + colIndex = oObj.getAccessibleColumn(chCount - 1) + bOK = bOK AND (colIndex >= 0) AND (colIndex <= colCount) + End If + colIndex = oObj.getAccessibleColumn(0) + bOK = bOK AND (colIndex >= 0) AND (colIndex <= colCount) + Test.MethodTested("getAccessibleColumn()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleTable/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleTable/script.xlb new file mode 100644 index 000000000000..4620dadd95c2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleTable/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="accessibility_XAccessibleTable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleTable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleText/accessibility_XAccessibleText.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleText/accessibility_XAccessibleText.xba new file mode 100644 index 000000000000..3a3973fedb0c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleText/accessibility_XAccessibleText.xba @@ -0,0 +1,201 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleText" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2008 by Sun Microsystems, Inc. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' $RCSfile: accessibility_XAccessibleText.xba,v $ +' +' $Revision: 1.5 $ +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global accText as String +' Global readOnly as Boolean + +'************************************************************************* + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleText +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim chCount As Integer + Dim accTextSegment as new com.sun.star.accessibility.TextSegment + + Test.StartMethod("getCharacterCount()") + bOK = true + chCount = oObj.getCharacterCount() + Out.Log("Character count: "+chCount) + bOK = bOK AND (len(accText) = chCount) + Test.MethodTested("getCharacterCount()",bOK) + + Test.StartMethod("getCaretPosition()") + Test.StartMethod("setCaretPosition()") + bOK = true + Dim carPos As Integer + oObj.setCaretPosition(chCount - 1) + carPos = oObj.getCaretPosition() + if not readOnly then + Out.Log("getCaretPosition: " + carPos) + bOK = bOK AND (carPos = chCount - 1) + else + Out.Log("Object is read only and Caret position couldn't be set") + end if + Test.MethodTested("getCaretPosition()",bOK) + Test.MethodTested("setCaretPosition()",bOK) + + Test.StartMethod("getCharacter()") + Dim i As Integer + bOK = true + for i = 0 to chCount-1 + bOK = bOK AND (chr(oObj.getCharacter(i)) = _ + utils.getCharacter(i+1,accText)) + next i + Test.MethodTested("getCharacter()",bOK) + + Test.StartMethod("getCharacterAttributes()") + Dim attrs() As Variant + Dim ReqAttrs(0) as String + bOK = true + attrs = oObj.getCharacterAttributes(chCount - 1, ReqAttrs()) + bOK = bOK AND NOT isNull(attrs) + Out.Log("Properties ubound: "+ubound(attrs)) + Test.MethodTested("getCharacterAttributes()",bOK) + + Test.StartMethod("getCharacterBounds()") + Dim chBounds As new com.sun.star.awt.Rectangle + bOK = true + chBounds = oObj.getCharacterBounds(chCount - 1) + Out.Log("Character boundbox: "+chBounds.X+", "+chBounds.Y+", "+ _ + chBounds.Width+", "+chBounds.Height) + bOK = bOK AND NOT isNull(chBounds) + Test.MethodTested("getCharacterBounds()",bOK) + + Test.StartMethod("getIndexAtPoint()") + Dim index As Integer + Dim point As new com.sun.star.awt.Point + bOK = true + point.X = chBounds.X + 1 + point.Y = chBounds.Y + 1 + index = oObj.getIndexAtPoint(point) + bOK = bOK AND (index = chCount -1) + Test.MethodTested("getIndexAtPoint()",bOK) + + Test.StartMethod("getSelectedText()") + bOK = true + oObj.setSelection(0, chCount) + if not readOnly then + bOK = bOK AND (accText = oObj.getSelectedText()) + else + Out.Log("Object is unselectable") + end if + Test.MethodTested("getSelectedText()",bOK) + + Test.StartMethod("getSelectionStart()") + bOK = true + oObj.setSelection(chCount-1,chCount) + if not readOnly then + bOK = bOK AND (oObj.getSelectionStart() = chCount -1) + else + Out.Log("Object is unselectable") + end if + Test.MethodTested("getSelectionStart()",bOK) + + Test.StartMethod("getSelectionEnd()") + bOK = true + oObj.setSelection(0,chCount - 1) + if not readOnly then + bOK = bOK AND (oObj.getSelectionEnd() = chCount - 1) + else + Out.Log("Object is unselectable") + end if + Test.MethodTested("getSelectionEnd()",bOK) + + Test.StartMethod("setSelection()") + bOK = true + if not readOnly then + bOK = bOK AND oObj.setSelection(0,chCount) + else + Out.Log("Object is unselectable") + end if + Test.MethodTested("setSelection()",bOK) + + Test.StartMethod("getText()") + bOK = true + bOK = bOK AND (accText = oObj.getText()) + Test.MethodTested("getText()",bOK) + + Test.StartMethod("getTextRange()") + bOK = true + bOK = bOK AND (accText = oObj.getTextRange(0,chCount)) + Test.MethodTested("getTextRange()",bOK) + + Test.StartMethod("getTextAtIndex()") + bOK = true + accTextSegment = oObj.getTextAtIndex(chCount - 1, 4) + bOK = bOK AND (accText = accTextSegment.SegmentText) + Test.MethodTested("getTextAtIndex()",bOK) + + Test.StartMethod("getTextBeforeIndex()") + bOK = true + accTextSegment = oObj.getTextBeforeIndex(1, 1) + bOK = bOK AND (accTextSegment.SegmentText = utils.getCharacter(1,accText)) + Test.MethodTested("getTextBeforeIndex()",bOK) + + Test.StartMethod("getTextBehindIndex()") + bOK = true + accTextSegment = oObj.getTextBehindIndex(chCount-2,1) + bOK = bOK AND (accTextSegment.SegmentText = utils.getCharacter(chCount,accText)) + Test.MethodTested("getTextBehindIndex()",bOK) + + Test.StartMethod("copyText()") + bOK = true + bOK = bOK AND oObj.copyText(0,chCount) + if readOnly then bOK = true + Test.MethodTested("copyText()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleText/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleText/script.xlb new file mode 100644 index 000000000000..26416634cad1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleText/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="accessibility_XAccessibleText" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleText"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleValue/accessibility_XAccessibleValue.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleValue/accessibility_XAccessibleValue.xba new file mode 100644 index 000000000000..4a9af21639f6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleValue/accessibility_XAccessibleValue.xba @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleValue" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2008 by Sun Microsystems, Inc. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' $RCSfile: accessibility_XAccessibleValue.xba,v $ +' +' $Revision: 1.3 $ +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleValue +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getMinimumValue()") + Dim minVal As Variant + bOK = true + minVal = oObj.getMinimumValue() + Out.Log("Minimum value is "+minVal) + Test.MethodTested("getMinimumValue()",bOK) + + Test.StartMethod("getMaximumValue()") + Dim maxVal As Variant + bOK = true + maxVal = oObj.getMaximumValue() + Out.Log("Maximum value is "+maxVal) + Test.MethodTested("getMaximumValue()",bOK) + + Test.StartMethod("getCurrentValue()") + Dim curVal As Variant + bOK = true + curVal = oObj.getCurrentValue() + bOK = bOK AND (curVal >= minVal) AND (curVal <= maxVal) + Test.MethodTested("getCurrentValue()",bOK) + + + Test.StartMethod("setCurrentValue()") + Dim newVal As Variant, resVal As Variant + bOK = true + newVal = curVal + 1 + if (newVal > maxVal) then newVal = newVal - 2 + + Out.Log("Setting new value: "+newVal) + bOK = bOK AND oObj.setCurrentValue(newVal) + resVal = oObj.getCurrentValue() + Out.Log("Result: "+resVal) + bOK = bOK AND (Abs(newVal - resVal) < 0.00001) + + Out.Log("Setting new value: "+minVal) + bOK = bOK AND oObj.setCurrentValue(minVal) + resVal = oObj.getCurrentValue() + Out.Log("Result: "+resVal) + bOK = bOK AND (Abs(minVal - resVal) < 0.00001) + + Out.Log("Setting new value: "+maxVal) + bOK = bOK AND oObj.setCurrentValue(maxVal) + resVal = oObj.getCurrentValue() + Out.Log("Result: "+resVal) + bOK = bOK AND (Abs(maxVal - resVal) < 0.00001) + + newVal = minVal - 1 + Out.Log("Setting new value: "+newVal) + bOK = bOK AND oObj.setCurrentValue(newVal) + resVal = oObj.getCurrentValue() + Out.Log("Result: "+resVal) + bOK = bOK AND (Abs(minVal - resVal) < 0.00001) + + newVal = maxVal + 1 + Out.Log("Setting new value: "+newVal) + bOK = bOK AND oObj.setCurrentValue(newVal) + resVal = oObj.getCurrentValue() + Out.Log("Result: "+resVal) + bOK = bOK AND (Abs(maxVal - resVal) < 0.00001) + + Test.MethodTested("setCurrentValue()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleValue/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleValue/script.xlb new file mode 100644 index 000000000000..24a50a082374 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleValue/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="accessibility_XAccessibleValue" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleValue"/> +"</library:library> |