The fixture creates two fullscreen surfaces and paints the default bufferstream. (I think that we're in the process of breaking that technique.)
Then we synthesise a keyboard event and wait for to reach the client.
If we don't see the event, then the test *passes*. That seems wrong.
If we do see the event we check that the second surface has focus. Why do we EXPECT that? That isn't what this test is about! And /this/ is the expectation that fails.
We then try raising surface2 and wait for it to have focus (which, we've just established it has).
TEST_F( RaiseSurfaces, key_event_ with_cookie) keyboard- >emit_event( mis::a_ key_down_ event() .of_scancode( KEY_M)) ;
{
fake_
int events = 1; n_events( events, this))
std::lock_ guard<std: :mutex> lk(mutex);
ASSERT_ FALSE(out_ cookies. empty() );
EXPECT_ EQ(mir_ surface_ get_focus( surface2) , mir_surface_ focused) ;
if (wait_for_
{
MirCookie const* cookie = mir_cookie_ from_buffer( out_cookies. back(). data(), out_cookies. back(). size()) ;
attempt_ focus(surface2, cookie);
}
}
WTF is this test intended to test?
The fixture creates two fullscreen surfaces and paints the default bufferstream. (I think that we're in the process of breaking that technique.)
Then we synthesise a keyboard event and wait for to reach the client.
If we don't see the event, then the test *passes*. That seems wrong.
If we do see the event we check that the second surface has focus. Why do we EXPECT that? That isn't what this test is about! And /this/ is the expectation that fails.
We then try raising surface2 and wait for it to have focus (which, we've just established it has).