| author | Remy Suen | 2011-10-04 16:16:05 (EDT) |
|---|---|---|
| committer | Dani Megert | 2011-11-17 10:02:00 (EST) |
| commit | 43e6123882e908156ced6daa2edbc52197c56f73 (patch) (side-by-side diff) | |
| tree | 68530ddf0188ffe371f9ce139be735a77f2d66f9 | |
| parent | 09220d483db2705d8462ed6bc09d5761589c12f6 (diff) | |
| download | eclipse.platform.ui-43e6123882e908156ced6daa2edbc52197c56f73.zip eclipse.platform.ui-43e6123882e908156ced6daa2edbc52197c56f73.tar.gz eclipse.platform.ui-43e6123882e908156ced6daa2edbc52197c56f73.tar.bz2 | |
Bug 359079 BindingPersistenceTest's testBindingTransform win32 x86 test
failed on N20110926-2000
It seems that the list of bindings in the binding manager is not
always populated properly when the test suite gets to
testBindingTransform. The fix is to activate the needed contexts
that has the required keybinding defined for the assertion
check.
| -rw-r--r-- | tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/BindingPersistenceTest.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/BindingPersistenceTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/BindingPersistenceTest.java index 5a0a57d..805c926 100644 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/BindingPersistenceTest.java +++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/BindingPersistenceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,6 +19,7 @@ import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.util.Util; import org.eclipse.swt.SWT; import org.eclipse.ui.commands.ICommandService; +import org.eclipse.ui.contexts.IContextService; import org.eclipse.ui.internal.WorkbenchPlugin; import org.eclipse.ui.keys.IBindingService; import org.eclipse.ui.tests.harness.util.UITestCase; @@ -206,7 +207,15 @@ public final class BindingPersistenceTest extends UITestCase { } assertEquals(3, numOfMarkers); assertTrue("Unable to find delete marker", foundDeleteMarker); - TriggerSequence[] activeBindingsFor = bindingService.getActiveBindingsFor(addWS); + + // make sure that the proper contexts are currently active + IContextService contextService = (IContextService) fWorkbench + .getService(IContextService.class); + contextService + .activateContext(IContextService.CONTEXT_ID_DIALOG_AND_WINDOW); + contextService.activateContext(IContextService.CONTEXT_ID_WINDOW); + TriggerSequence[] activeBindingsFor = bindingService + .getActiveBindingsFor(addWS); assertEquals(1, activeBindingsFor.length); } |

