Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-05-14 21:27:04 +0000
committerPawel Piech2012-05-14 21:30:45 +0000
commitb83750eae0df3b119136d279ff7e6736d6a3c982 (patch)
tree8825c0d1840af2739bf33bb506d1b9e357ea7a72 /dsf/org.eclipse.cdt.tests.dsf
parent03d1253f689c45fcc963eff82837595a1e12ce73 (diff)
downloadorg.eclipse.cdt-b83750eae0df3b119136d279ff7e6736d6a3c982.tar.gz
org.eclipse.cdt-b83750eae0df3b119136d279ff7e6736d6a3c982.tar.xz
org.eclipse.cdt-b83750eae0df3b119136d279ff7e6736d6a3c982.zip
Bug 379317 - SimpleDisplayExecutable posts runnables as separate UI event queue elements
Updated the performance test to better simulate debuggers' view model.
Diffstat (limited to 'dsf/org.eclipse.cdt.tests.dsf')
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMNode.java80
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMProvider.java17
2 files changed, 66 insertions, 31 deletions
diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMNode.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMNode.java
index c7f11ac9988..cde46005a60 100644
--- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMNode.java
+++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMNode.java
@@ -15,7 +15,6 @@ import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants;
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
import org.eclipse.cdt.dsf.debug.ui.viewmodel.numberformat.FormattedValueLabelText;
import org.eclipse.cdt.dsf.ui.viewmodel.AbstractVMNode;
-import org.eclipse.cdt.dsf.ui.viewmodel.AbstractVMProvider;
import org.eclipse.cdt.dsf.ui.viewmodel.IRootVMNode;
import org.eclipse.cdt.dsf.ui.viewmodel.VMDelta;
import org.eclipse.cdt.dsf.ui.viewmodel.properties.IElementPropertiesProvider;
@@ -60,48 +59,69 @@ public class TestModelVMNode extends AbstractVMNode implements IRootVMNode, IEle
fLabelProvider.update(updates);
}
- public TestModelVMNode(AbstractVMProvider provider) {
+ public TestModelVMNode(TestModelVMProvider provider) {
super(provider);
}
- public void update(IHasChildrenUpdate[] updates) {
- for (IHasChildrenUpdate update : updates) {
- if (update.getElement() instanceof TestElementVMContext) {
- TestElement element = ((TestElementVMContext)update.getElement()).getElement();
- update.setHasChilren(element.getChildren().length != 0);
+ private TestModelVMProvider getTestProvider() {
+ return (TestModelVMProvider)getVMProvider();
+
+ }
+
+ public void update(final IHasChildrenUpdate[] updates) {
+ getTestProvider().getDsfExecutor().execute(new Runnable() {
+ public void run() {
+ for (IHasChildrenUpdate update : updates) {
+ if (update.getElement() instanceof TestElementVMContext) {
+ TestElement element = ((TestElementVMContext)update.getElement()).getElement();
+ update.setHasChilren(element.getChildren().length != 0);
+ }
+ update.done();
+ }
}
- update.done();
- }
+ });
}
- public void update(IChildrenCountUpdate[] updates) {
- for (IChildrenCountUpdate update : updates) {
- if (update.getElement() instanceof TestElementVMContext) {
- TestElement element = ((TestElementVMContext)update.getElement()).getElement();
- update.setChildCount(element.getChildren().length);
+ public void update(final IChildrenCountUpdate[] updates) {
+ getTestProvider().getDsfExecutor().execute(new Runnable() {
+ public void run() {
+ for (IChildrenCountUpdate update : updates) {
+ if (update.getElement() instanceof TestElementVMContext) {
+ TestElement element = ((TestElementVMContext)update.getElement()).getElement();
+ update.setChildCount(element.getChildren().length);
+ }
+ update.done();
+ }
}
- update.done();
- }
+ });
}
- public void update(IChildrenUpdate[] updates) {
- for (IChildrenUpdate update : updates) {
- if (update.getElement() instanceof TestElementVMContext) {
- TestElement element = ((TestElementVMContext)update.getElement()).getElement();
- fillUpdateWithTestElements(update, element.getChildren());
+ public void update(final IChildrenUpdate[] updates) {
+ getTestProvider().getDsfExecutor().execute(new Runnable() {
+ public void run() {
+ for (IChildrenUpdate update : updates) {
+ if (update.getElement() instanceof TestElementVMContext) {
+ TestElement element = ((TestElementVMContext)update.getElement()).getElement();
+ fillUpdateWithTestElements(update, element.getChildren());
+ }
+ update.done();
+ }
}
- update.done();
- }
+ });
}
- public void update(IPropertiesUpdate[] updates) {
- for (IPropertiesUpdate update : updates) {
- if (update.getElement() instanceof TestElementVMContext) {
- TestElement element = ((TestElementVMContext)update.getElement()).getElement();
- update.setProperty(PROP_TEST_ELEMENT_LABEL, element.getLabel());
+ public void update(final IPropertiesUpdate[] updates) {
+ getTestProvider().getDsfExecutor().execute(new Runnable() {
+ public void run() {
+ for (IPropertiesUpdate update : updates) {
+ if (update.getElement() instanceof TestElementVMContext) {
+ TestElement element = ((TestElementVMContext)update.getElement()).getElement();
+ update.setProperty(PROP_TEST_ELEMENT_LABEL, element.getLabel());
+ }
+ update.done();
+ }
}
- update.done();
- }
+ });
}
private void fillUpdateWithTestElements(IChildrenUpdate update, TestElement[] elements) {
diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMProvider.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMProvider.java
index a53186d1b8e..6a2265a35db 100644
--- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMProvider.java
+++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMProvider.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.vm;
+import org.eclipse.cdt.dsf.concurrent.DefaultDsfExecutor;
+import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
import org.eclipse.cdt.dsf.ui.viewmodel.AbstractVMAdapter;
import org.eclipse.cdt.dsf.ui.viewmodel.AbstractVMProvider;
import org.eclipse.cdt.dsf.ui.viewmodel.IVMModelProxy;
@@ -23,14 +25,27 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationCont
*/
public class TestModelVMProvider extends AbstractVMProvider {
+ private DsfExecutor fDsfExecutor;
+
public TestModelVMProvider(AbstractVMAdapter adapter, IPresentationContext context) {
super(adapter, context);
+ fDsfExecutor = new DefaultDsfExecutor("TestModelVMProvider");
+
setRootNode(new TestModelVMNode(this));
addChildNodes(getRootVMNode(), new IVMNode[] { getRootVMNode() });
}
-
+ @Override
+ public void dispose() {
+ super.dispose();
+ fDsfExecutor.shutdown();
+ }
+
+ public DsfExecutor getDsfExecutor() {
+ return fDsfExecutor;
+ }
+
public TestElementVMContext getElementVMContext(IPresentationContext context, TestElement element) {
return ((TestModelVMNode)getRootVMNode()).createVMContext(element);
}

Back to the top