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

Also cope with intermittend DisposedExceptions

...while waiting for the .uno:PrintPreview request to be processed, see
5b5c52a3 "Try make this more robust in slow
environments."  (However, to avoid an endless loop in case DisposedExceptions
are caused by a crash of soffice.bin, cap the loop at 10 sec.)

Change-Id: I13518eea46deb68731604ef08461bad5bb5f7cdf
üst 77df4f89
......@@ -39,6 +39,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.XMultiServiceFactory;
import com.sun.star.sheet.XHeaderFooterContent;
import com.sun.star.sheet.XSpreadsheet;
......@@ -138,12 +139,13 @@ public class ScAccessiblePageHeader extends TestCase {
AccessibilityTools at = new AccessibilityTools();
XInterface oObj = null;
for (;;) {
for (int i = 0;; ++i) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
try {
XWindow xWindow = AccessibilityTools.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
if (xRoot != null) {
......@@ -155,6 +157,13 @@ public class ScAccessiblePageHeader extends TestCase {
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 HEADER found yet, retrying");
}
......
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