Bug 301573 Saveable dialog remains open during automated testing
We probably want to use the tweaklet to replace the e4 save handler with a test version. Thread [main] (Suspended) OS.Call(int, int, int, int) line: not available [native method] Display.sleep() line: 3964 WBWRenderer$SaveablePartPromptDialog(Window).runEventLoop(Shell) line: 826 WBWRenderer$SaveablePartPromptDialog(Window).open() line: 801 WBWRenderer.promptForSave(Shell, Collection<MPart>) line: 418 WBWRenderer.access$2(WBWRenderer, Shell, Collection) line: 414 WBWRenderer$4.promptToSave(Collection<MPart>) line: 240 PartServiceImpl.saveAll(boolean) line: 476 WBWRenderer$6.shellClosed(ShellEvent) line: 348 TypedListener.handleEvent(Event) line: 92 EventTable.sendEvent(Event) line: 84 Shell(Widget).sendEvent(Event) line: 1223 Shell(Widget).sendEvent(int, Event, boolean) line: 1247 Shell(Widget).sendEvent(int, Event) line: 1232 Shell.closeWidget() line: 614 Shell.close() line: 610 PartRenderingEngine.stop() line: 534 E4Workbench.close() line: 120 E4Testable$2.run() line: 115 RunnableLock.run() line: 35 Synchronizer.runAsyncMessages(boolean) line: 134 Display.runAsyncMessages(boolean) line: 3501 Display.readAndDispatch() line: 3148 PartRenderingEngine$5.run() line: 511 Realm.runWithDefault(Realm, Runnable) line: 332 PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 433 E4Workbench.createAndRunUI(MApplicationElement) line: 81 E4Application.start(IApplicationContext) line: 104 UITestApplication.start(IApplicationContext) line: 47 EclipseAppHandle.run(Object) line: 194 EclipseAppLauncher.runApplication(Object) line: 110 EclipseAppLauncher.start(Object) line: 79 EclipseStarter.run(Object) line: 367 EclipseStarter.run(String[], Runnable) line: 179 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 59 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 39 Method.invoke(Object, Object...) line: 612 Main.invokeFramework(String[], URL[]) line: 611 Main.basicRun(String[]) line: 566 Main.run(String[]) line: 1363 Main.main(String[]) line: 1339
tests/org.eclipse.e4.ui.compat.tests.tweaklet/src/org/eclipse/e4/ui/compat/tests/tweaklet/TestFacadeE4Impl.java
package org.eclipse.e4.ui.compat.tests.tweaklet;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.e4.core.services.context.IEclipseContext;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.MPart;
import org.eclipse.e4.workbench.modeling.ISaveHandler;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IPageService;
import org.eclipse.ui.IPartService;
import org.eclipse.ui.ISaveablePart2;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.e4.compatibility.E4Util;
import org.eclipse.ui.internal.e4.compatibility.Workbench;
import org.eclipse.ui.tests.helpers.TestFacade;
public class TestFacadeE4Impl extends TestFacade {