Kaydet (Commit) 5b5c52a3 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Try make this more robust in slow environments

...where the previous .uno:PrintPreview request has not yet been processed and
xRoot/oObj would still be null.  Hopefully, it does not introduce infinite
loops, though.

Change-Id: Ie79e0b0a3185528ab4036ed7a33de81117c02c83
üst 09c09fa2
...@@ -90,8 +90,6 @@ public class ScAccessiblePageHeader extends TestCase { ...@@ -90,8 +90,6 @@ public class ScAccessiblePageHeader extends TestCase {
protected TestEnvironment createTestEnvironment( protected TestEnvironment createTestEnvironment(
TestParameters Param, PrintWriter log) { TestParameters Param, PrintWriter log) {
XInterface oObj = null;
// inserting some content to have non-empty page preview // inserting some content to have non-empty page preview
XCell xCell = null; XCell xCell = null;
try { try {
...@@ -137,20 +135,28 @@ public class ScAccessiblePageHeader extends TestCase { ...@@ -137,20 +135,28 @@ public class ScAccessiblePageHeader extends TestCase {
throw new StatusException(Status.failed("Couldn't change mode")); throw new StatusException(Status.failed("Couldn't change mode"));
} }
try {
Thread.sleep(500);
} catch (InterruptedException ex) {}
AccessibilityTools at = new AccessibilityTools(); AccessibilityTools at = new AccessibilityTools();
XWindow xWindow = AccessibilityTools.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel); XInterface oObj = null;
XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); for (;;) {
try {
oObj = AccessibilityTools.getAccessibleObjectForRole Thread.sleep(500);
(xRoot, AccessibleRole.HEADER, ""); } catch (InterruptedException e) {
throw new RuntimeException(e);
log.println("ImplementationName " + utils.getImplName(oObj)); }
AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); XWindow xWindow = AccessibilityTools.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
if (xRoot != null) {
oObj = AccessibilityTools.getAccessibleObjectForRole
(xRoot, AccessibleRole.HEADER, "");
if (oObj != null) {
log.println("ImplementationName " + utils.getImplName(oObj));
AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
break;
}
}
log.println("No HEADER found yet, retrying");
}
TestEnvironment tEnv = new TestEnvironment(oObj); TestEnvironment tEnv = new TestEnvironment(oObj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment