Mir

Code review comment for lp:~kdub/mir/compositor-double-start-stop

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

Is that case something we should care about?

TEST(MultiThreadedCompositor, double_threaded_start_ignored)
{
    unsigned int const nbuffers{3};
    auto display = std::make_shared<StubDisplayWithMockBuffers>(nbuffers);
    auto mock_scene = std::make_shared<MockScene>();
    auto db_compositor_factory = std::make_shared<NullDisplayBufferCompositorFactory>();
    auto mock_report = std::make_shared<testing::NiceMock<mtd::MockCompositorReport>>();
    EXPECT_CALL(*mock_report, started())
        .Times(1);

    mc::MultiThreadedCompositor compositor{display, mock_scene, db_compositor_factory, mock_report};

    std::thread{[&](){ compositor.start()} };
    std::thread{[&](){ compositor.start()} };
}

review: Needs Information

« Back to merge proposal