diff options
author | Roland Grunberg | 2013-07-04 19:20:51 +0000 |
---|---|---|
committer | Camilo Bernal | 2013-07-04 20:02:36 +0000 |
commit | 956cf7ff451239d9818aa290c95730f95e8df731 (patch) | |
tree | c8997617ba45597240faf06310db5de0a5f7fc6d /perf/org.eclipse.linuxtools.perf.tests | |
parent | d4ddc8225334a2d1183f33d61405b1860c34b59f (diff) | |
download | org.eclipse.linuxtools-956cf7ff451239d9818aa290c95730f95e8df731.tar.gz org.eclipse.linuxtools-956cf7ff451239d9818aa290c95730f95e8df731.tar.xz org.eclipse.linuxtools-956cf7ff451239d9818aa290c95730f95e8df731.zip |
Remove unnecessary PerfProfileView reference in PerfPlugin.
Change-Id: Iecc4f1ae636c36e03e4cfad20ec5263b04486e47
Reviewed-on: https://git.eclipse.org/r/14278
Tested-by: Hudson CI
Reviewed-by: Camilo Bernal <cabernal@redhat.com>
IP-Clean: Camilo Bernal <cabernal@redhat.com>
Tested-by: Camilo Bernal <cabernal@redhat.com>
Diffstat (limited to 'perf/org.eclipse.linuxtools.perf.tests')
-rw-r--r-- | perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/ModelTest.java | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/ModelTest.java b/perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/ModelTest.java index fb76197847..f0124699e1 100644 --- a/perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/ModelTest.java +++ b/perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/ModelTest.java @@ -39,7 +39,10 @@ import org.eclipse.linuxtools.internal.perf.model.PMFile; import org.eclipse.linuxtools.internal.perf.model.PMSymbol; import org.eclipse.linuxtools.internal.perf.model.TreeParent; import org.eclipse.linuxtools.internal.perf.ui.PerfDoubleClickAction; +import org.eclipse.linuxtools.internal.perf.ui.PerfProfileView; import org.eclipse.linuxtools.profiling.tests.AbstractTest; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; import org.osgi.framework.FrameworkUtil; public class ModelTest extends AbstractTest { @@ -119,15 +122,22 @@ public class ModelTest extends AbstractTest { int numOfParents = getNumberOfParents(invisibleRoot) - 1; // create a double click action to act on the tree viewer - TreeViewer tv = PerfPlugin.getDefault().getProfileView().getTreeViewer(); - PerfDoubleClickAction dblClick = new PerfDoubleClickAction(tv); - - // double click every element - doubleClickAllChildren(invisibleRoot, tv, dblClick); - - // If all elements are expanded, this is the number of elements - // in our model that have children. - assertEquals(numOfParents, tv.getExpandedElements().length); + try { + PerfProfileView view = (PerfProfileView) PlatformUI.getWorkbench() + .getActiveWorkbenchWindow().getActivePage() + .showView(PerfPlugin.VIEW_ID); + TreeViewer tv = view.getTreeViewer(); + PerfDoubleClickAction dblClick = new PerfDoubleClickAction(tv); + + // double click every element + doubleClickAllChildren(invisibleRoot, tv, dblClick); + + // If all elements are expanded, this is the number of elements + // in our model that have children. + assertEquals(numOfParents, tv.getExpandedElements().length); + } catch (PartInitException e) { + fail("Failed to open the Profiling View."); + } } public void testParserMultiEvent() { |