mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
mark testonly back to discourage usage
This commit is contained in:
@@ -158,7 +158,7 @@ class StoreAwareProjectManager(virtualFileManager: VirtualFileManager, progressM
|
||||
}
|
||||
|
||||
override fun flushChangedProjectFileAlarm() {
|
||||
changedFilesAlarm.flush()
|
||||
changedFilesAlarm.drainRequestsInTest()
|
||||
}
|
||||
|
||||
override fun reloadProject(project: Project) {
|
||||
|
||||
@@ -255,7 +255,8 @@ public class Alarm implements Disposable {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void flush() {
|
||||
@TestOnly
|
||||
public void drainRequestsInTest() {
|
||||
List<Runnable> unfinishedTasks;
|
||||
synchronized (LOCK) {
|
||||
if (myRequests.isEmpty()) {
|
||||
|
||||
@@ -174,18 +174,18 @@ public abstract class EditorBasedStatusBarPopup extends EditorBasedWidget implem
|
||||
@TestOnly
|
||||
public void updateInTests(boolean immediately) {
|
||||
update();
|
||||
update.flush();
|
||||
update.drainRequestsInTest();
|
||||
UIUtil.dispatchAllInvocationEvents();
|
||||
if (immediately) {
|
||||
// for widgets with background activities, the first flush() adds handlers to be called
|
||||
update.flush();
|
||||
update.drainRequestsInTest();
|
||||
UIUtil.dispatchAllInvocationEvents();
|
||||
}
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public void flushUpdateInTests() {
|
||||
update.flush();
|
||||
update.drainRequestsInTest();
|
||||
}
|
||||
|
||||
public void update() {
|
||||
|
||||
@@ -151,7 +151,7 @@ public class AlarmTest extends PlatformTestCase {
|
||||
alarm.addRequest(() -> sb.append("1"), 0, ModalityState.NON_MODAL);
|
||||
alarm.addRequest(() -> sb.append("2"), 5, ModalityState.NON_MODAL);
|
||||
assertEquals("", sb.toString());
|
||||
alarm.flush();
|
||||
alarm.drainRequestsInTest();
|
||||
assertEquals("12", sb.toString());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user