forked from qt-creator/qt-creator
CppEditor/CppTools: Fix plugin tests in master.
Change-Id: Ia641c70f8c72cf762cf571cdd505385d28492b7c Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "cppmodelmanager.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/plugintestutils.h>
|
||||
#include <coreplugin/testdatadir.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <locator/locatorfiltertest.h>
|
||||
@@ -125,8 +126,7 @@ private:
|
||||
|
||||
virtual void doAfterLocatorRun()
|
||||
{
|
||||
EditorManager::closeEditor(m_editor, /*askAboutModifiedEditors=*/ false);
|
||||
QCoreApplication::processEvents();
|
||||
Core::Tests::closeAndDeleteEditor(m_editor);
|
||||
QVERIFY(EditorManager::documentModel()->openedDocuments().isEmpty());
|
||||
m_modelManager->GC();
|
||||
QVERIFY(m_modelManager->snapshot().isEmpty());
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "modelmanagertesthelper.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/plugintestutils.h>
|
||||
#include <coreplugin/testdatadir.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/session.h>
|
||||
@@ -725,7 +726,7 @@ void CppToolsPlugin::test_modelmanager_gc_if_last_cppeditor_closed()
|
||||
QVERIFY(mm->snapshot().contains(file));
|
||||
|
||||
// Close file/editor
|
||||
Core::EditorManager::closeEditor(editor, /*askAboutModifiedEditors=*/ false);
|
||||
Core::Tests::closeAndDeleteEditor(editor);
|
||||
helper.waitForFinishedGc();
|
||||
|
||||
// Check: File is removed from the snapshpt
|
||||
@@ -762,7 +763,7 @@ void CppToolsPlugin::test_modelmanager_dont_gc_opened_files()
|
||||
QVERIFY(mm->snapshot().contains(file));
|
||||
|
||||
// Close editor
|
||||
Core::EditorManager::closeEditors(QList<Core::IEditor*>() << editor);
|
||||
Core::Tests::closeAndDeleteEditor(editor);
|
||||
helper.waitForFinishedGc();
|
||||
QVERIFY(mm->snapshot().isEmpty());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user