diff --git a/src/core/window-private.h b/src/core/window-private.h index eca352298..fd0dcaa45 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -900,3 +900,6 @@ void meta_window_inhibit_suspend_state (MetaWindow *window); void meta_window_uninhibit_suspend_state (MetaWindow *window); gboolean meta_window_is_suspended (MetaWindow *window); + +META_EXPORT_TEST +int meta_get_window_suspend_timeout_s (void); diff --git a/src/core/window.c b/src/core/window.c index 0660bf69f..8ea18a5bc 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -7999,3 +7999,9 @@ meta_window_calculate_bounds (MetaWindow *window, return FALSE; } } + +int +meta_get_window_suspend_timeout_s (void) +{ + return SUSPEND_HIDDEN_TIMEOUT_S; +} diff --git a/src/tests/test-runner.c b/src/tests/test-runner.c index abb124768..2eac7b79d 100644 --- a/src/tests/test-runner.c +++ b/src/tests/test-runner.c @@ -175,10 +175,11 @@ test_case_wait (TestCase *test, static gboolean test_case_sleep (TestCase *test, - guint32 interval, + uint32_t interval_ms, GError **error) { - g_timeout_add_full (G_PRIORITY_LOW, interval, test_case_loop_quit, test, NULL); + g_timeout_add_full (G_PRIORITY_LOW, interval_ms, + test_case_loop_quit, test, NULL); g_main_loop_run (test->loop); return TRUE; @@ -847,16 +848,18 @@ test_case_do (TestCase *test, } else if (strcmp (argv[0], "sleep") == 0) { - guint64 interval; + uint64_t interval_ms; if (argc != 2) - BAD_COMMAND("usage: %s ", argv[0]); + BAD_COMMAND("usage: %s |", argv[0]); - if (!g_ascii_string_to_unsigned (argv[1], 10, 0, G_MAXUINT32, - &interval, error)) + if (strcmp (argv[1], "suspend_timeout") == 0) + interval_ms = s2ms (meta_get_window_suspend_timeout_s ()); + else if (!g_ascii_string_to_unsigned (argv[1], 10, 0, G_MAXUINT32, + &interval_ms, error)) return FALSE; - if (!test_case_sleep (test, (guint32) interval, error)) + if (!test_case_sleep (test, (uint32_t) interval_ms, error)) return FALSE; } else if (strcmp (argv[0], "set_strut") == 0)