void () { final ConsoleViewImpl console1 = ConsoleViewImplTest.createConsole(false, getProject()); final ConsoleViewImpl console2 = ConsoleViewImplTest.createConsole(false, getProject()); final DuplexConsoleView<ConsoleViewImpl, ConsoleViewImpl> duplexConsoleView = new DuplexConsoleView<>(console1, console2); Disposer.register(myDisposable, duplexConsoleView); final AnAction clearAction = findAction(duplexConsoleView.createConsoleActions(), "Clear"); assertNotNull(clearAction); console1.print("FooBar", ConsoleViewContentType.NORMAL_OUTPUT); console2.print("BazFoo", ConsoleViewContentType.NORMAL_OUTPUT); console1.flushDeferredText(); console2.flushDeferredText(); clearAction.actionPerformed(AnActionEvent.createFromAnAction(clearAction, null, ActionPlaces.EDITOR_TOOLBAR, DataContext.EMPTY_CONTEXT)); console1.waitAllRequests(); console2.waitAllRequests(); assertEquals(0, console1.getContentSize()); assertEquals(0, console2.getContentSize()); }