summaryrefslogtreecommitdiff
path: root/qadevOOo
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2013-09-30 15:28:02 +0100
committerMichael Meeks <michael.meeks@collabora.com>2013-09-30 15:28:57 +0100
commita9cf50c24dd10a20e1288828e2a59c193bb582cb (patch)
tree875dd6e2ff3d67df317298dd09cbe48b3e41cae7 /qadevOOo
parentab683542cd78e225a2e11e405e1cd8cfce99461a (diff)
junit: make tests robust by compensating for intermittent sizing race.
Diffstat (limited to 'qadevOOo')
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java
index fd8833b1b89e..069520652450 100644
--- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java
@@ -477,15 +477,21 @@ public class _XAccessibleComponent extends MultiMethodTest {
public void _getSize() {
requiredMethod("getBounds()");
- boolean result = true;
+ boolean result = false;
Size size = oObj.getSize();
- result &= (size.Width == bounds.Width);
- result &= (size.Height == bounds.Height);
- if (!result) {
- log.println(
- "bounds " + bounds.Width + "x" + bounds.Height + " vs. size "
- + size.Width + "x" + size.Height);
+ for (int i = 0; i < 2 && !result; i++)
+ {
+ result = true;
+ result &= (size.Width == bounds.Width);
+ result &= (size.Height == bounds.Height);
+ if (!result) {
+ log.println( "potential race bounds " + bounds.Width + "x" + bounds.Height +
+ " vs. size " + size.Width + "x" + size.Height);
+ // Possibily we hit a race condition and it re-sized (?) ...
+ bounds = oObj.getBounds();
+ size = oObj.getSize();
+ }
}
tRes.tested("getSize()", result);