use of com.intellij.testFramework.BombedProgressIndicator in project intellij-community by JetBrains.
the class ProgressIndicatorTest method testBombedIndicator.
public void testBombedIndicator() {
final int count = 10;
new BombedProgressIndicator(count).runBombed(() -> {
for (int i = 0; i < count * 2; i++) {
TimeoutUtil.sleep(10);
try {
ProgressManager.checkCanceled();
if (i >= count) {
ProgressManager.checkCanceled();
fail("PCE expected on " + i + "th check");
}
} catch (ProcessCanceledException e) {
if (i < count) {
fail("Too early PCE");
}
}
}
});
}
Aggregations