~vanvugt/mir/heresy

« back to all changes in this revision

Viewing changes to tests/unit-tests/scene/test_application_session.cpp

  • Committer: Daniel van Vugt
  • Date: 2015-06-03 07:35:16 UTC
  • mfrom: (2600.2.13 development-branch)
  • Revision ID: daniel.van.vugt@canonical.com-20150603073516-av54iqy9ngrkrf2t
Merge latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
    ~MockSnapshotStrategy() noexcept {}
68
68
 
69
69
    MOCK_METHOD2(take_snapshot_of,
70
 
                void(std::shared_ptr<ms::SurfaceBufferAccess> const&,
 
70
                void(std::shared_ptr<mc::BufferStream> const&,
71
71
                     ms::SnapshotCallback const&));
72
72
};
73
73
 
410
410
 
411
411
    auto mock_surface = make_mock_surface();
412
412
    NiceMock<MockSurfaceFactory> surface_factory;
 
413
    MockBufferStreamFactory mock_buffer_stream_factory;
 
414
    std::shared_ptr<mc::BufferStream> const mock_stream = std::make_shared<mtd::MockBufferStream>();
 
415
    ON_CALL(mock_buffer_stream_factory, create_buffer_stream(_)).WillByDefault(Return(mock_stream));
413
416
    ON_CALL(surface_factory, create_surface(_,_)).WillByDefault(Return(mock_surface));
414
417
    NiceMock<mtd::MockSurfaceCoordinator> surface_coordinator;
415
418
 
416
 
    auto const default_surface_buffer_access =
417
 
        std::static_pointer_cast<ms::SurfaceBufferAccess>(mock_surface);
418
419
    auto const snapshot_strategy = std::make_shared<MockSnapshotStrategy>();
419
420
 
420
 
    EXPECT_CALL(*snapshot_strategy,
421
 
                take_snapshot_of(default_surface_buffer_access, _));
 
421
    EXPECT_CALL(*snapshot_strategy, take_snapshot_of(mock_stream, _));
422
422
 
423
423
    ms::ApplicationSession app_session(
424
424
        mt::fake_shared(surface_coordinator),
425
425
        mt::fake_shared(surface_factory),
426
 
        stub_buffer_stream_factory,
 
426
        mt::fake_shared(mock_buffer_stream_factory),
427
427
        pid, name,
428
428
        snapshot_strategy,
429
429
        std::make_shared<ms::NullSessionListener>(),