qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java | 55 ++++++---- qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java | 2 2 files changed, 33 insertions(+), 24 deletions(-)
New commits: commit dcee4cfcdc0adab82eec1bd68b68dea7eeee549c Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Oct 8 10:52:56 2013 +0200 Try make this more robust in slow environments ...where the previous .uno:PrintPreview request has not yet been processed, the same way it had been made more robust for ScAccessiblePageHeader.java in 5b5c52a3a4d048bba8c18dfb06ffca25c670d099 "Try make this more robust in slow environments" plus b5dd2b4218f966e177d880bcc29fa5fba3bfe1c1 "Also cope with intermittend DisposedExceptions." Change-Id: I4d429a96b7b595776aaf3fa20e3e03b00ca886bc diff --git a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java index 535e92d..26e9ff1 100644 --- a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java +++ b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java @@ -38,6 +38,7 @@ import com.sun.star.frame.XController; import com.sun.star.frame.XDispatch; import com.sun.star.frame.XDispatchProvider; import com.sun.star.frame.XModel; +import com.sun.star.lang.DisposedException; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.sheet.XSpreadsheet; @@ -86,7 +87,6 @@ public class AccessibleEditableTextPara_PreviewCell extends TestCase { */ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { - XAccessibleContext oObj = null; XCell xCell = null; try { @@ -136,19 +136,38 @@ public class AccessibleEditableTextPara_PreviewCell extends TestCase { throw new StatusException(Status.failed("Couldn't change mode")); } - shortWait(); - - - XWindow xWindow = AccessibilityTools.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), xModel); - XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); - //AccessibilityTools.printAccessibleTree(log,xRoot); - AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL,true); - - xRoot = AccessibilityTools.SearchedAccessible; - - //AccessibilityTools.printAccessibleTree(log,xRoot); - - oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot,AccessibleRole.PARAGRAPH); + XAccessibleContext oObj = null; + for (int i = 0;; ++i) { + try { + Thread.sleep(500); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + try { + XAccessible xRoot = AccessibilityTools.getAccessibleObject( + AccessibilityTools.getCurrentWindow( + (XMultiServiceFactory) Param.getMSF(), xModel)); + if (xRoot != null) { + AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.TABLE_CELL, true); + xRoot = AccessibilityTools.SearchedAccessible; + if (xRoot != null) { + oObj = AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.PARAGRAPH); + if (oObj != null) { + break; + } + } + } + } catch (DisposedException e) { + log.println("Ignoring DisposedException"); + } + if (i == 20) { // give up after 10 sec + throw new RuntimeException( + "Couldn't get AccessibleRoot.HEADER object"); + } + log.println("No TABLE_CELL/PARAGRAPH found yet, retrying"); + } log.println("ImplementationName " + utils.getImplName(oObj)); log.println("AccessibleName " + oObj.getAccessibleName()); @@ -169,12 +188,4 @@ public class AccessibleEditableTextPara_PreviewCell extends TestCase { return tEnv; } - - protected void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } } commit f52d78bf7cc0ae5fcaf1b693e5bfa98bb015c569 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Oct 8 10:52:07 2013 +0200 Unused variable (AccessibilityTools is all static members) Change-Id: I5f3be57dea77cec1cfa3f48833758b0c2328350e diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java index f1f7b07..484ccf4 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java @@ -136,8 +136,6 @@ public class ScAccessiblePageHeader extends TestCase { throw new StatusException(Status.failed("Couldn't change mode")); } - AccessibilityTools at = new AccessibilityTools(); - XInterface oObj = null; for (int i = 0;; ++i) { try { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits