void test(const QString &testname, KisProcessingVisitorSP visitor) {
        KisSurrogateUndoStore *undoStore = new KisSurrogateUndoStore();
        KisImageSP image = createImage(undoStore);
        image->initialRefreshGraph();

        QVERIFY(checkLayersInitial(image));

        KisProcessingApplicator applicator(image, image->root(),
                                           KisProcessingApplicator::RECURSIVE);

        applicator.applyVisitor(visitor);
        applicator.end();
        image->waitForDone();

        QVERIFY(checkLayers(image, testname));

        undoStore->undo();
        image->waitForDone();

        QVERIFY(checkLayersInitial(image));
    }
Esempio n. 2
0
    ZoomAndPanTester()
        // we are not going to use our own QImage sets,so
        // just exploit the set of the selection manager test
        : QImageBasedTest("selection_manager_test")
    {
        m_undoStore = new KisSurrogateUndoStore();
        m_image = createImage(m_undoStore);
        m_image->initialRefreshGraph();
        QVERIFY(checkLayersInitial(m_image));

        m_doc = KisPart::instance()->createDocument();

        m_doc->setCurrentImage(m_image);

        m_mainWindow = KisPart::instance()->createMainWindow();
        m_view = new KisView(m_doc, m_mainWindow->resourceManager(), m_mainWindow->actionCollection(), m_mainWindow);

        m_image->refreshGraph();

        m_mainWindow->show();
    }
    ZoomAndPanTester()
        // we are not going to use our own QImage sets,so
        // just exploit the set of the selection manager test
        : QImageBasedTest("selection_manager_test")
    {
        m_undoStore = new KisSurrogateUndoStore();
        m_image = createImage(m_undoStore);
        m_image->initialRefreshGraph();
        QVERIFY(checkLayersInitial(m_image));

        m_part = new KisPart2(0);

        m_doc = new KisDoc2(m_part);
        m_doc->setCurrentImage(m_image);

        m_part->setDocument(m_doc);

        m_shell = new KoMainWindow(m_part->componentData());
        m_view = new KisView2(m_part, m_doc, m_shell);

        m_image->refreshGraph();

        m_shell->show();
    }
 void checkUndoWait() {
     undoStore->undo();
     QTest::qWait(1000);
     image->waitForDone();
     QVERIFY(checkLayersInitial());
 }