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 {
protected TestEnvironment createTestEnvironment(
TestParameters Param, PrintWriter log) {
XInterface oObj = null;
// inserting some content to have non-empty page preview
XCell xCell = null;
try {
......@@ -137,20 +135,28 @@ public class ScAccessiblePageHeader extends TestCase {
throw new StatusException(Status.failed("Couldn't change mode"));
}
try {
Thread.sleep(500);
} catch (InterruptedException ex) {}
AccessibilityTools at = new AccessibilityTools();
XInterface oObj = null;
for (;;) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
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);
......
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