Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2019-04-17 21:07:20 +0000
committerLars Vogel2019-04-18 10:51:43 +0000
commitc09ec86e8408eb6bd0dadbb9a502d69b1561ebe4 (patch)
treee5b02ef65b1cfde99117751b59e0d5391884f1c6
parent7b079786b30254bb58f67be360a9ee5f9156486f (diff)
downloadeclipse.platform.ui-c09ec86e8408eb6bd0dadbb9a502d69b1561ebe4.tar.gz
eclipse.platform.ui-c09ec86e8408eb6bd0dadbb9a502d69b1561ebe4.tar.xz
eclipse.platform.ui-c09ec86e8408eb6bd0dadbb9a502d69b1561ebe4.zip
Bug 546539 - [tests] Improve ProgressViewTests.testNoUpdatesIfHidden
reliability The test tried to hide the progress view by opening another view. But that other view might not open in the same part and the progress view remains visible. Change-Id: I7b11c3561363eb63d2afb628f1f516935937067e Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressTestCase.java5
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressViewTests.java10
2 files changed, 9 insertions, 6 deletions
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressTestCase.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressTestCase.java
index c6a9f6bcc4a..26950d5832d 100644
--- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressTestCase.java
+++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressTestCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * Copyright (c) 2009, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -29,7 +29,7 @@ import org.eclipse.ui.tests.harness.util.UITestCase;
public abstract class ProgressTestCase extends UITestCase {
protected ProgressView progressView;
- private IWorkbenchWindow window;
+ protected IWorkbenchWindow window;
/**
* @param testName
@@ -65,5 +65,4 @@ public abstract class ProgressTestCase extends UITestCase {
window.getActivePage().hideView(progressView);
processEvents();
}
-
} \ No newline at end of file
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressViewTests.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressViewTests.java
index 4b5a8593451..b1da2ab47ba 100644
--- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressViewTests.java
+++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressViewTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * Copyright (c) 2009, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,7 +16,7 @@ package org.eclipse.ui.tests.progress;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.internal.progress.FinishedJobs;
import org.eclipse.ui.internal.progress.JobInfo;
import org.eclipse.ui.internal.progress.JobTreeElement;
@@ -72,7 +72,11 @@ public class ProgressViewTests extends ProgressTestCase {
public void testNoUpdatesIfHidden() throws Exception {
// test for
openProgressView();
- openView(IPageLayout.ID_TASK_LIST);
+ // minimize progress view to reliably hide it
+ IWorkbenchPage activePage = window.getActivePage();
+ activePage.setPartState(activePage.getActivePartReference(), IWorkbenchPage.STATE_MINIMIZED);
+ processEvents();
+ assertFalse("Progress view still visible.", activePage.isPartVisible(progressView));
// run the jobs, view is hidden
Job job1 = runDummyJob();

Back to the top