summaryrefslogtreecommitdiff
path: root/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java')
-rw-r--r--platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java
index db9cebf954f6..9695bf8529fb 100644
--- a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@ package com.intellij.openapi.fileEditor;
import com.intellij.ide.ui.UISettings;
import com.intellij.mock.Mock;
+import com.intellij.openapi.fileEditor.impl.EditorWindow;
import com.intellij.openapi.fileEditor.impl.EditorWithProviderComposite;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
@@ -101,6 +102,20 @@ public class FileEditorManagerTest extends FileEditorManagerTestCase {
assertEquals("mockEditor", myManager.getSelectedEditor(file).getName());
}
+ public void testWindowClosingRetainsOtherWindows() throws Exception {
+ VirtualFile file = getFile("/src/1.txt");
+ assertNotNull(file);
+ myManager.openFile(file, false);
+ EditorWindow primaryWindow = myManager.getCurrentWindow();
+ assertNotNull(primaryWindow);
+ myManager.createSplitter(SwingConstants.VERTICAL, primaryWindow);
+ EditorWindow secondaryWindow = myManager.getNextWindow(primaryWindow);
+ assertNotNull(secondaryWindow);
+ myManager.createSplitter(SwingConstants.VERTICAL, secondaryWindow);
+ myManager.closeFile(file, primaryWindow);
+ assertEquals(2, myManager.getWindows().length);
+ }
+
private static final String STRING = "<component name=\"FileEditorManager\">\n" +
" <leaf>\n" +
" <file leaf-file-name=\"1.txt\" pinned=\"false\" current=\"false\" current-in-tab=\"false\">\n" +