~alan-griffiths/mir/workaround-lp1602199

« back to all changes in this revision

Viewing changes to tests/unit-tests/compositor/test_buffer_stream.cpp

  • Committer: Tarmac
  • Author(s): Kevin DuBois
  • Date: 2016-05-03 09:49:54 UTC
  • mfrom: (3369.2.31 server-side-alloc)
  • Revision ID: tarmac-20160503094954-6l9jtr20mydxs3l7
server: Change point of frontend-facing buffer allocation from the mf::BufferStream to the msc::Session to prepare for NBS connection-allocated buffers.

We were previously allocating from the streams, but to accommodate mir_connection_allocate_buffer(), we will have to allocate via msc::Session.

This exposes mf::ClientBuffers(), as the streams need to reflect that buffers came from the same Session/connection. (cross-connection/cross-process mirclient-allocated-buffers are not supported). render_surfaces has an example of a 'floating' shell buffer stream that didn't originate from IPC.

Approved by mir-ci-bot, Cemil Azizoglu, Chris Halse Rogers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
    buffer_stream.swap_buffers(buffer, complete);
233
233
}
234
234
 
235
 
TEST_F(BufferStreamTest, allocate_and_release_not_supported)
236
 
{
237
 
    mg::BufferProperties properties;
238
 
    mc::BufferStreamSurfaces buffer_stream(mock_bundle);
239
 
    EXPECT_THROW({
240
 
        buffer_stream.allocate_buffer(properties);
241
 
    }, std::logic_error);
242
 
    EXPECT_THROW({
243
 
        buffer_stream.remove_buffer(mg::BufferID{3});
244
 
    }, std::logic_error);
245
 
}
246
 
 
247
235
TEST_F(BufferStreamTest, scale_resizes_and_sets_size_appropriately)
248
236
{
249
237
    using namespace testing;