mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix bug in test utility resulting in intermittent failures
This commit is contained in:
parent
fd0887f7bc
commit
5784926857
1 changed files with 5 additions and 1 deletions
|
@ -41,6 +41,7 @@ import org.eclipse.ui.PartInitException;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
import org.eclipse.ui.WorkbenchException;
|
import org.eclipse.ui.WorkbenchException;
|
||||||
import org.eclipse.ui.handlers.IHandlerService;
|
import org.eclipse.ui.handlers.IHandlerService;
|
||||||
|
import org.eclipse.ui.internal.WorkbenchPartReference;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||||
|
@ -282,12 +283,15 @@ public class BaseUITestCase extends BaseTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
final protected TreeItem checkTreeNode(IViewPart part, int i0, String label) {
|
final protected TreeItem checkTreeNode(IViewPart part, int i0, String label) {
|
||||||
|
IViewReference viewRef = part.getViewSite().getPage().findViewReference(part.getViewSite().getId());
|
||||||
|
Control viewControl = ((WorkbenchPartReference)viewRef).getPane().getControl();
|
||||||
|
|
||||||
Tree tree= null;
|
Tree tree= null;
|
||||||
TreeItem root= null;
|
TreeItem root= null;
|
||||||
StringBuilder cands= new StringBuilder();
|
StringBuilder cands= new StringBuilder();
|
||||||
for (int i= 0; i < 400; i++) {
|
for (int i= 0; i < 400; i++) {
|
||||||
cands.setLength(0);
|
cands.setLength(0);
|
||||||
Control[] trees= findControls(part.getSite().getShell(), Tree.class);
|
Control[] trees= findControls(viewControl, Tree.class);
|
||||||
for (int j = 0; j < trees.length; j++) {
|
for (int j = 0; j < trees.length; j++) {
|
||||||
try {
|
try {
|
||||||
tree= (Tree) trees[j];
|
tree= (Tree) trees[j];
|
||||||
|
|
Loading…
Add table
Reference in a new issue