diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2017-08-18 14:23:42 +0800 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2017-08-30 13:44:05 +0800 |
commit | 5b37901b575ad4ca9250fcae297cdf0333b87ff3 (patch) | |
tree | d9a4f193bc2c8aad6c5cd85fdea05202b0ac006c | |
parent | 2df4ccd1cdf11ea96aa9f12990ec5a34690806de (diff) | |
download | mutter-5b37901b575ad4ca9250fcae297cdf0333b87ff3.tar.gz |
tests/utils: Add test_client_quit() helper
https://bugzilla.gnome.org/show_bug.cgi?id=730551
-rw-r--r-- | src/tests/test-runner.c | 5 | ||||
-rw-r--r-- | src/tests/test-utils.c | 13 | ||||
-rw-r--r-- | src/tests/test-utils.h | 3 |
3 files changed, 17 insertions, 4 deletions
diff --git a/src/tests/test-runner.c b/src/tests/test-runner.c index dd239acc3..8867945c1 100644 --- a/src/tests/test-runner.c +++ b/src/tests/test-runner.c @@ -365,10 +365,7 @@ test_case_do (TestCase *test, if (!client) return FALSE; - if (!test_client_do (client, error, "destroy_all", NULL)) - return FALSE; - - if (!test_client_wait (client, error)) + if (!test_client_quit (client, error)) return FALSE; g_hash_table_remove (test->clients, test_client_get_id (client)); diff --git a/src/tests/test-utils.c b/src/tests/test-utils.c index 88d1bc307..18b6da356 100644 --- a/src/tests/test-utils.c +++ b/src/tests/test-utils.c @@ -396,6 +396,19 @@ test_client_new (const char *id, return client; } +gboolean +test_client_quit (TestClient *client, + GError **error) +{ + if (!test_client_do (client, error, "destroy_all", NULL)) + return FALSE; + + if (!test_client_wait (client, error)) + return FALSE; + + return TRUE; +} + void test_client_destroy (TestClient *client) { diff --git a/src/tests/test-utils.h b/src/tests/test-utils.h index 5b57ef634..61250a798 100644 --- a/src/tests/test-utils.h +++ b/src/tests/test-utils.h @@ -70,6 +70,9 @@ MetaWindow * test_client_find_window (TestClient *client, const char *window_id, GError **error); +gboolean test_client_quit (TestClient *client, + GError **error); + TestClient * test_client_new (const char *id, MetaWindowClientType type, GError **error); |