From dd07de149dbba16b07d199a36110e83c0163947b Mon Sep 17 00:00:00 2001 From: Artem Gainanov Date: Wed, 30 May 2018 15:22:41 +0700 Subject: [PATCH] [gui-test] GUI-114 execute get current file name on edt --- .../testGuiFramework/fixtures/FileEditorFixture.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/FileEditorFixture.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/FileEditorFixture.java index ad1e13234ba4..a5a06f898968 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/FileEditorFixture.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/FileEditorFixture.java @@ -84,8 +84,15 @@ public class FileEditorFixture extends EditorFixture { */ @Nullable public String getCurrentFileName() { - VirtualFile currentFile = getCurrentFile(); - return currentFile != null ? currentFile.getName() : null; + final String[] fileName = {null}; + execute(new GuiTask() { + @Override + protected void executeInEDT() throws Throwable { + VirtualFile currentFile = getCurrentFile(); + fileName[0] = currentFile != null ? currentFile.getName() : null; + } + }); + return fileName[0]; } /** @@ -367,5 +374,4 @@ public class FileEditorFixture extends EditorFixture { public Boolean hasTab(@NotNull final String tabName) { return tabs.hasTab(tabName); } - }