virtual_image: Open a window for race conditions during open/close

Delay the open/close callbacks by 100ms so that we have a window of
opportunity for race conditions. This is needed to test certain
conditiosn in fprintd.
This commit is contained in:
Benjamin Berg 2020-05-12 19:15:23 +02:00 committed by Marco Trevisan
parent fab349f356
commit a63dcc96d5

View file

@ -288,7 +288,8 @@ dev_init (FpImageDevice *dev)
start_listen (self);
fpi_image_device_open_complete (dev, NULL);
/* Delay result to open up the possibility of testing race conditions. */
fpi_device_add_timeout (FP_DEVICE (dev), 100, (FpTimeoutFunc) fpi_image_device_open_complete, NULL, NULL);
}
static void
@ -303,7 +304,8 @@ dev_deinit (FpImageDevice *dev)
g_clear_object (&self->listener);
g_clear_object (&self->connection);
fpi_image_device_close_complete (dev, NULL);
/* Delay result to open up the possibility of testing race conditions. */
fpi_device_add_timeout (FP_DEVICE (dev), 100, (FpTimeoutFunc) fpi_image_device_close_complete, NULL, NULL);
}
static void