| 288 | |
| 289 | |
| 290 | void TestShellBuddy::testDisableAll() |
| 291 | { |
| 292 | /* 6. Disable buddy option, Disable open next to active tab |
| 293 | Open foo.cpp bar.l.txt foo.l.txt |
| 294 | Activate bar.l.txt |
| 295 | Open bar.cpp |
| 296 | Verify order (foo.cpp bar.l.txt foo.l.txt bar.cpp) |
| 297 | Verify that bar.cpp is activated*/ |
| 298 | QCOMPARE(m_documentController->openDocuments().count(), 0); |
| 299 | enableBuddies(false); |
| 300 | enableOpenAfterCurrent(false); |
| 301 | |
| 302 | QTemporaryDir dirA; |
| 303 | createFile(dirA, QStringLiteral("foo.l.txt")); |
| 304 | createFile(dirA, QStringLiteral("foo.r.txt")); |
| 305 | createFile(dirA, QStringLiteral("bar.l.txt")); |
| 306 | createFile(dirA, QStringLiteral("bar.r.txt")); |
| 307 | |
| 308 | m_documentController->openDocument(QUrl::fromLocalFile(dirA.path() + "foo.r.txt")); |
| 309 | m_documentController->openDocument(QUrl::fromLocalFile(dirA.path() + "bar.l.txt")); |
| 310 | m_documentController->openDocument(QUrl::fromLocalFile(dirA.path() + "foo.l.txt")); |
| 311 | Sublime::Area *area = m_uiController->activeArea(); |
| 312 | Sublime::AreaIndex* areaIndex = area->indexOf(m_uiController->activeSublimeWindow()->activeView()); |
| 313 | |
| 314 | //activate bar.l.txt |
| 315 | m_uiController->activeSublimeWindow()->activateView(areaIndex->views().value(1)); |
| 316 | |
| 317 | m_documentController->openDocument(QUrl::fromLocalFile(dirA.path() + "bar.r.txt")); |
| 318 | |
| 319 | verifyFilename(areaIndex->views().value(0), "foo.r.txt"); |
| 320 | verifyFilename(areaIndex->views().value(1), "bar.l.txt"); |
| 321 | verifyFilename(areaIndex->views().value(2), "foo.l.txt"); |
| 322 | verifyFilename(areaIndex->views().value(3), "bar.r.txt"); |
| 323 | verifyFilename(m_uiController->activeSublimeWindow()->activeView(), "bar.r.txt"); |
| 324 | |
| 325 | QCOMPARE(m_documentController->openDocuments().count(), 4); |
| 326 | for(int i = 0; i < 4; i++) |
| 327 | m_documentController->openDocuments().at(0)->close(IDocument::Discard); |
| 328 | QCOMPARE(m_documentController->openDocuments().count(), 0); |
| 329 | } |
| 330 | |
| 331 | //////////////////////////////////////////////////////////////////////////////// |
| 332 | //////////////////////////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected