View | Details | Raw Unified | Return to bug 298952
Collapse All | Expand All

(-)src/org/eclipse/jface/tests/performance/ProgressMonitorDialogPerformanceTest.java (-20 / +15 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
2
 * Copyright (c) 2007, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 13-19 Link Here
13
13
14
import java.lang.reflect.InvocationTargetException;
14
import java.lang.reflect.InvocationTargetException;
15
15
16
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.IProgressMonitor;
16
import org.eclipse.core.runtime.IProgressMonitor;
18
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
17
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
19
import org.eclipse.jface.operation.IRunnableWithProgress;
18
import org.eclipse.jface.operation.IRunnableWithProgress;
Lines 21-27 Link Here
21
import org.eclipse.swt.widgets.Shell;
20
import org.eclipse.swt.widgets.Shell;
22
import org.eclipse.test.performance.Dimension;
21
import org.eclipse.test.performance.Dimension;
23
import org.eclipse.ui.tests.performance.BasicPerformanceTest;
22
import org.eclipse.ui.tests.performance.BasicPerformanceTest;
24
import org.eclipse.ui.tests.performance.TestRunnable;
25
23
26
/**
24
/**
27
 * @since 3.3
25
 * @since 3.3
Lines 55-60 Link Here
55
53
56
		tagIfNecessary("JFace - 10000 element task name in progress dialog",
54
		tagIfNecessary("JFace - 10000 element task name in progress dialog",
57
				Dimension.ELAPSED_PROCESS);
55
				Dimension.ELAPSED_PROCESS);
56
		setDegradationComment("The test changed in 3.7. For details, consult bug 298952.");
58
		
57
		
59
		Display display = Display.getCurrent();
58
		Display display = Display.getCurrent();
60
		if (display == null) {
59
		if (display == null) {
Lines 70-95 Link Here
70
				for (int i = 0; i < chars.length; i++) {
69
				for (int i = 0; i < chars.length; i++) {
71
					chars[i] = 'A';
70
					chars[i] = 'A';
72
				}
71
				}
73
				
74
				final String taskName = new String(chars);
72
				final String taskName = new String(chars);
75
				final IProgressMonitor finalMonitor = monitor;
76
				
73
				
77
				try {
74
				// warm up
78
					exercise(new TestRunnable() {
75
				monitor.setTaskName(taskName);
79
						public void run() {
76
				processEvents();
80
							startMeasuring();
77
				
81
							finalMonitor.setTaskName(taskName);
78
				// test
82
							processEvents();
79
				for (int testCounter = 0; testCounter < 20; testCounter++) {
83
							stopMeasuring();
80
					startMeasuring();
84
						}
81
					for (int counter = 0; counter < 30; counter++) {
85
					}, ViewerTest.MIN_ITERATIONS, ViewerTest.ITERATIONS,
82
						monitor.setTaskName(taskName);
86
							JFacePerformanceSuite.MAX_TIME);
83
						processEvents();
87
				} catch (CoreException e) {
84
					}
88
					fail(e.getMessage(), e);
85
					processEvents();
86
					stopMeasuring();
89
				}
87
				}
90
91
			
92
93
			}
88
			}
94
		};
89
		};
95
90

Return to bug 298952