~kgunn72/mir/mir-mwc-ppa-disable-tests

« back to all changes in this revision

Viewing changes to tests/unit-tests/graphics/mesa/test_guest_platform.cpp

mesa: Add auth_fd platform operation. Fixes: https://bugs.launchpad.net/bugs/1379266.

Approved by Cemil Azizoglu, Alan Griffiths, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
 
62
62
}
63
63
 
64
 
TEST_F(MesaGuestPlatformTest, auth_magic_is_delegated_to_nested_context)
 
64
TEST_F(MesaGuestPlatformTest, auth_fd_is_delegated_to_nested_context)
65
65
{
66
66
    using namespace testing;
67
67
 
68
 
    int const success{0};
69
 
    mg::PlatformOperationMessage auth_magic_success_response;
70
 
    auth_magic_success_response.data.resize(sizeof(MirMesaAuthMagicResponse));
71
 
    *reinterpret_cast<MirMesaAuthMagicResponse*>(
72
 
        auth_magic_success_response.data.data()) =
73
 
            MirMesaAuthMagicResponse{success};
 
68
    int const auth_fd{13};
 
69
    mg::PlatformOperationMessage auth_fd_response{{},{auth_fd}};
74
70
 
75
71
    EXPECT_CALL(mock_nested_context,
76
 
                platform_operation(MirMesaPlatformOperation::auth_magic, _))
77
 
        .WillOnce(Return(auth_magic_success_response));
 
72
                platform_operation(MirMesaPlatformOperation::auth_fd, _))
 
73
        .WillOnce(Return(auth_fd_response));
78
74
 
79
75
    mgm::GuestPlatform native(mt::fake_shared(mock_nested_context));
80
76
    auto ipc_ops = native.make_ipc_operations();