void () { VirtualFile dir = find("newEncoding"); VirtualFile file = Objects.requireNonNull(dir.findFileByRelativePath("src/xxx.txt")); Document document = Objects.requireNonNull(FileDocumentManager.getInstance().getDocument(file)); assertNotNull(document.getText()); UIUtil.dispatchAllInvocationEvents(); Project newEncodingProject = PlatformTestUtil.loadAndOpenProject(dir.toNioPath(), getTestRootDisposable()); assertEquals(US_ASCII, file.getCharset()); assertTrue(newEncodingProject.isOpen()); }