| 155 | } |
| 156 | |
| 157 | void TestWorkingSetController::switchArea() |
| 158 | { |
| 159 | // Create a persistent working set |
| 160 | m_area->setWorkingSet(setName2); |
| 161 | auto set2 = m_workingSetCtrl->workingSet(m_area->workingSet()); |
| 162 | set2->setPersistent(true); |
| 163 | m_documentCtrl->openDocument(QUrl::fromLocalFile(m_file.fileName())); |
| 164 | |
| 165 | // Create and activate another persistent working set |
| 166 | m_area->setWorkingSet(setName); |
| 167 | auto set = m_workingSetCtrl->workingSet(m_area->workingSet()); |
| 168 | set->setPersistent(true); |
| 169 | m_documentCtrl->openDocument(QUrl::fromLocalFile(m_file.fileName())); |
| 170 | m_documentCtrl->openDocumentFromText(QString()); // add an unsaved document |
| 171 | |
| 172 | Core::self()->uiController()->switchToArea(QStringLiteral("debug"), IUiController::ThisWindow); |
| 173 | m_area_debug = Core::self()->uiControllerInternal()->activeArea(); |
| 174 | // explicitly set the current working set, as in DebugController::addSession |
| 175 | m_area_debug->setWorkingSet(setName, m_area->workingSetPersistent(), m_area); |
| 176 | |
| 177 | QTRY_COMPARE(m_closedSets->layout()->count(), 1); // working set 2 |
| 178 | QTRY_COMPARE(m_area_debug->views().size(), 2); // check that the unsaved document is displayed, BUG 486746 |
| 179 | |
| 180 | m_area_debug->setWorkingSet(setName2); |
| 181 | m_documentCtrl->openDocumentFromText(QString()); // add two unsaved documents |
| 182 | m_documentCtrl->openDocumentFromText(QString()); |
| 183 | |
| 184 | QTest::qSleep(1000); |
| 185 | QCOMPARE(m_closedSets->layout()->count(), 1); // working set 1, BUG 375446 |
| 186 | |
| 187 | Core::self()->uiController()->switchToArea(QStringLiteral("code"), IUiController::ThisWindow); |
| 188 | // explicitly set the current working set, as in DebugController::debuggerStateChanged |
| 189 | m_area->setWorkingSet(setName2, m_area_debug->workingSetPersistent(), m_area_debug); |
| 190 | |
| 191 | QTRY_COMPARE(m_area->views().size(), 3); // check that both unsaved documents are displayed, BUG 486746 |
| 192 | |
| 193 | m_area->setWorkingSet(setName); |
| 194 | |
| 195 | QTRY_COMPARE(m_closedSets->layout()->count(), 1); // working set 2, BUG 375446 |
| 196 | } |
| 197 | |
| 198 | void TestWorkingSetController::restoreSplits() |
| 199 | { |
nothing calls this directly
no test coverage detected