~brandontschaefer/mir/lp.1233089-fix-v-h-scroll

« back to all changes in this revision

Viewing changes to tests/unit-tests/frontend/test_session_mediator.cpp

  • Committer: Tarmac
  • Author(s): Alan Griffiths, Daniel van Vugt, Kevin Gunn, Daniel d'Andrada, Kevin DuBois, Robert Ancell, Alexandros Frantzis
  • Date: 2013-10-03 03:48:54 UTC
  • mfrom: (1081.3.23 development-branch)
  • Revision ID: tarmac-20131003034854-xt39hgpdwywgkdox
* bump deb changelog to 0.0.13 and libmirserver5.
lp:~kgunn72/mir/bump-libmirserver5-take2

* graphics: android: disable vsync notifications when screen is off as per hwc specs. rename unblank_or_blank_display to apply_display_state() to remove ambiguity about what is being done.
fixes: lp1233870. Fixes: https://bugs.launchpad.net/bugs/1233870.
branch lp:~kdub/mir/deactive-notifications-when-display-off

* Simplify {Default,Basic}DisplayBufferCompositor classes into one.
branch lp:~vanvugt/mir/simplify-DisplayBufferCompositors

* Make cross-compile-chroot.sh build in parallel when suitable
branch lp:~dandrader/mir/cross-compile-parallel

* Fix race in connection failures. Fixes: https://bugs.launchpad.net/bugs/1201436.
branch lp:~alan-griffiths/mir/fix-1201436
Bug #1201436: Intermittent hang in ClientPidTestFixture.authorizer_may_prevent_connection_of_clients test

* Privatize surface_data.h; not required in any public APIs.
Fixes: https://bugs.launchpad.net/bugs/1223393.
branch lp:~vanvugt/mir/privatize-SurfaceData

* client: Clean up client side error handling and suicide if connection fails
branch lp:~alan-griffiths/mir/client-dies-without-server

* frontend, logging: Provide reporting from frontend::Connector.
branch lp:~alan-griffiths/mir/frontend-ConnectorReport-enablement

* Properly track buffers per-surface (not per session). Failure to do so was
causing premature buffer release and re-use in cases with multiple surfaces
per client/session. In XMir this was seen as out of order, glitchy and slow
frames when using multiple monitors (LP: #1216472). Fixes: https://bugs.launchpad.net/bugs/1216472.
branch lp:~afrantzis/mir/fix-out-of-order-buffers-1216472.

Approved by PS Jenkins bot, Robert Ancell.

Show diffs side-by-side

added added

removed removed

Lines of Context:
545
545
    mediator.disconnect(nullptr, nullptr, nullptr, null_callback.get());
546
546
}
547
547
 
 
548
TEST_F(SessionMediatorTest, buffer_resource_for_surface_held_over_operations_on_other_surfaces)
 
549
{
 
550
    using namespace testing;
 
551
 
 
552
    auto stub_buffer1 = std::make_shared<mtd::StubBuffer>();
 
553
 
 
554
    mp::ConnectParameters connect_parameters;
 
555
    mp::Connection connection;
 
556
 
 
557
    mediator.connect(nullptr, &connect_parameters, &connection, null_callback.get());
 
558
    mp::SurfaceParameters surface_request;
 
559
    mp::Surface surface_response;
 
560
 
 
561
    /*
 
562
     * Note that the surface created by the first create_surface() call is
 
563
     * the pre-created stubbed_session->mock_surface. Further create_surface()
 
564
     * invocations create new surfaces in stubbed_session->mock_surfaces[].
 
565
     */
 
566
    EXPECT_CALL(*stubbed_session->mock_surface, advance_client_buffer())
 
567
        .WillOnce(Return(stub_buffer1));
 
568
 
 
569
    mediator.create_surface(nullptr, &surface_request, &surface_response, null_callback.get());
 
570
    auto refcount = stub_buffer1.use_count();
 
571
 
 
572
    /* Creating a new surface should not affect other surfaces' buffers */
 
573
    mediator.create_surface(nullptr, &surface_request, &surface_response, null_callback.get());
 
574
    EXPECT_EQ(refcount, stub_buffer1.use_count());
 
575
 
 
576
    mp::SurfaceId buffer_request{surface_response.id()};
 
577
    mp::Buffer buffer_response;
 
578
 
 
579
    /* Getting the next buffer of a surface should not affect other surfaces' buffers */
 
580
    mediator.next_buffer(nullptr, &buffer_request, &buffer_response, null_callback.get());
 
581
    EXPECT_EQ(refcount, stub_buffer1.use_count());
 
582
 
 
583
    mediator.disconnect(nullptr, nullptr, nullptr, null_callback.get());
 
584
}
 
585
 
548
586
TEST_F(SessionMediatorTest, display_config_request)
549
587
{
550
588
    using namespace testing;