@ -161,28 +161,28 @@ TEST(text_test)
/* Make sure our test surface has keyboard focus. */
/* Make sure our test surface has keyboard focus. */
wl_test_activate_surface ( client - > test - > wl_test ,
wl_test_activate_surface ( client - > test - > wl_test ,
client - > surface - > wl_surface ) ;
client - > surface - > wl_surface ) ;
wl_display _roundtrip( client - > wl_display ) ;
client _roundtrip( client ) ;
assert ( client - > input - > keyboard - > focus = = client - > surface ) ;
assert ( client - > input - > keyboard - > focus = = client - > surface ) ;
/* Activate test model and make sure we get enter event. */
/* Activate test model and make sure we get enter event. */
text_model_activate ( text_model , client - > input - > wl_seat ,
text_model_activate ( text_model , client - > input - > wl_seat ,
client - > surface - > wl_surface ) ;
client - > surface - > wl_surface ) ;
wl_display _roundtrip( client - > wl_display ) ;
client _roundtrip( client ) ;
assert ( state . activated = = 1 & & state . deactivated = = 0 ) ;
assert ( state . activated = = 1 & & state . deactivated = = 0 ) ;
/* Deactivate test model and make sure we get leave event. */
/* Deactivate test model and make sure we get leave event. */
text_model_deactivate ( text_model , client - > input - > wl_seat ) ;
text_model_deactivate ( text_model , client - > input - > wl_seat ) ;
wl_display _roundtrip( client - > wl_display ) ;
client _roundtrip( client ) ;
assert ( state . activated = = 1 & & state . deactivated = = 1 ) ;
assert ( state . activated = = 1 & & state . deactivated = = 1 ) ;
/* Activate test model again. */
/* Activate test model again. */
text_model_activate ( text_model , client - > input - > wl_seat ,
text_model_activate ( text_model , client - > input - > wl_seat ,
client - > surface - > wl_surface ) ;
client - > surface - > wl_surface ) ;
wl_display _roundtrip( client - > wl_display ) ;
client _roundtrip( client ) ;
assert ( state . activated = = 2 & & state . deactivated = = 1 ) ;
assert ( state . activated = = 2 & & state . deactivated = = 1 ) ;
/* Take keyboard focus away and verify we get leave event. */
/* Take keyboard focus away and verify we get leave event. */
wl_test_activate_surface ( client - > test - > wl_test , NULL ) ;
wl_test_activate_surface ( client - > test - > wl_test , NULL ) ;
wl_display _roundtrip( client - > wl_display ) ;
client _roundtrip( client ) ;
assert ( state . activated = = 2 & & state . deactivated = = 2 ) ;
assert ( state . activated = = 2 & & state . deactivated = = 2 ) ;
}
}