Skip to content

Commit 1d2149c

Browse files
committed
Remove unnecessary disablement of CloseTestWindowsRule in leak test
UITestCase provides a method to disable window tracking of the CloseTestWindowsRule, which is only used at a single place that does not even require it. This change removes the methods and the according usage.
1 parent 7cbe001 commit 1d2149c

File tree

2 files changed

+9
-25
lines changed
  • tests
    • org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util
    • org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/leaks

2 files changed

+9
-25
lines changed

tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/UITestCase.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,4 @@ protected void doTearDown() throws Exception {
154154
closeTestWindows.after();
155155
}
156156

157-
/**
158-
* Set whether the window listener will manage opening and closing of created windows.
159-
*/
160-
protected void manageWindows(boolean manage) {
161-
closeTestWindows.setEnabled(manage);
162-
}
163-
164-
165157
}

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/leaks/LeakTests.java

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -285,25 +285,17 @@ public void testTextEditorContextMenu() throws Exception {
285285

286286
@Test
287287
public void testSimpleWindowLeak() throws Exception {
288-
// turn off window management so that we dont have a reference to our
289-
// new
290-
// window in the listener
291-
manageWindows(false);
288+
ReferenceQueue queue = new ReferenceQueue();
289+
IWorkbenchWindow newWindow = openTestWindow();
290+
291+
assertNotNull(newWindow);
292+
Reference ref = createReference(queue, newWindow);
292293
try {
293-
ReferenceQueue queue = new ReferenceQueue();
294-
IWorkbenchWindow newWindow = openTestWindow();
295-
296-
assertNotNull(newWindow);
297-
Reference ref = createReference(queue, newWindow);
298-
try {
299-
newWindow.close();
300-
newWindow = null;
301-
checkRef(queue, ref);
302-
} finally {
303-
ref.clear();
304-
}
294+
newWindow.close();
295+
newWindow = null;
296+
checkRef(queue, ref);
305297
} finally {
306-
manageWindows(true);
298+
ref.clear();
307299
}
308300
}
309301

0 commit comments

Comments
 (0)