~mir-team/mir/development-branch

« back to all changes in this revision

Viewing changes to tests/acceptance-tests/test_nested_mir.cpp

  • Committer: Tarmac
  • Author(s): Alberto Aguirre
  • Date: 2017-01-19 06:34:41 UTC
  • mfrom: (3958.1.2 devel)
  • Revision ID: tarmac-20170119063441-nnq2b33tgq7370bl
tests: NestedServer: Wait to receive session_disconnect_called before
stopping the server

Make the test wait until session_disconnect_called is received before
stopping the server, avoiding a race between stopping the main loop and
the main loop dispatching the session_disconnect_called call.
(LP: #1643432). Fixes: https://bugs.launchpad.net/bugs/1643432.

Approved by mir-ci-bot, Daniel van Vugt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
738
738
 
739
739
TEST_F(NestedServer, nested_platform_connects_and_disconnects)
740
740
{
 
741
    mt::Signal signal;
741
742
    InSequence seq;
742
743
    EXPECT_CALL(*mock_session_mediator_report, session_connect_called(_)).Times(1);
743
 
    EXPECT_CALL(*mock_session_mediator_report, session_disconnect_called(_)).Times(1);
 
744
    EXPECT_CALL(*mock_session_mediator_report, session_disconnect_called(_))
 
745
        .Times(1)
 
746
        .WillOnce(mt::WakeUp(&signal));
744
747
 
745
748
    NestedMirRunner{new_connection()};
 
749
 
 
750
    EXPECT_TRUE(signal.wait_for(30s));
746
751
}
747
752
 
748
753
TEST_F(NestedServerWithTwoDisplays, sees_expected_outputs)