tests/cursor-tests: Move cursor state helper to test utils
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4205>
This commit is contained in:
@ -19,7 +19,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "backends/meta-cursor-sprite-xcursor.h"
|
#include "backends/meta-cursor-sprite-xcursor.h"
|
||||||
#include "backends/meta-cursor-tracker-private.h"
|
|
||||||
#include "backends/meta-logical-monitor.h"
|
#include "backends/meta-logical-monitor.h"
|
||||||
#include "backends/meta-screen-cast.h"
|
#include "backends/meta-screen-cast.h"
|
||||||
#include "clutter/clutter.h"
|
#include "clutter/clutter.h"
|
||||||
@ -319,16 +318,6 @@ wait_for_no_windows (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
meta_wait_for_window_cursor (void)
|
|
||||||
{
|
|
||||||
MetaBackend *backend = meta_context_get_backend (test_context);
|
|
||||||
MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend);
|
|
||||||
|
|
||||||
while (!meta_cursor_tracker_has_window_cursor (cursor_tracker))
|
|
||||||
g_main_context_iteration (NULL, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_client_cursor (ClutterStageView *view,
|
test_client_cursor (ClutterStageView *view,
|
||||||
const char *scale_method,
|
const char *scale_method,
|
||||||
@ -363,7 +352,7 @@ test_client_cursor (ClutterStageView *view,
|
|||||||
meta_wait_for_window_shown (window);
|
meta_wait_for_window_shown (window);
|
||||||
window_actor = meta_window_actor_from_window (window);
|
window_actor = meta_window_actor_from_window (window);
|
||||||
g_assert_nonnull (window_actor);
|
g_assert_nonnull (window_actor);
|
||||||
meta_wait_for_window_cursor ();
|
meta_wait_for_window_cursor (test_context);
|
||||||
|
|
||||||
meta_ref_test_verify_view (view,
|
meta_ref_test_verify_view (view,
|
||||||
ref_test_name,
|
ref_test_name,
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <X11/Xlib-xcb.h>
|
#include <X11/Xlib-xcb.h>
|
||||||
|
|
||||||
|
#include "backends/meta-cursor-tracker-private.h"
|
||||||
#include "backends/meta-monitor-config-store.h"
|
#include "backends/meta-monitor-config-store.h"
|
||||||
#include "backends/meta-virtual-monitor.h"
|
#include "backends/meta-virtual-monitor.h"
|
||||||
#include "backends/native/meta-backend-native.h"
|
#include "backends/native/meta-backend-native.h"
|
||||||
@ -994,3 +995,13 @@ meta_wait_test_process (GSubprocess *subprocess)
|
|||||||
g_main_loop_run (loop);
|
g_main_loop_run (loop);
|
||||||
g_assert_true (g_subprocess_get_successful (subprocess));
|
g_assert_true (g_subprocess_get_successful (subprocess));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_wait_for_window_cursor (MetaContext *context)
|
||||||
|
{
|
||||||
|
MetaBackend *backend = meta_context_get_backend (context);
|
||||||
|
MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend);
|
||||||
|
|
||||||
|
while (!meta_cursor_tracker_has_window_cursor (cursor_tracker))
|
||||||
|
g_main_context_iteration (NULL, TRUE);
|
||||||
|
}
|
||||||
|
@ -136,3 +136,6 @@ GSubprocess * meta_launch_test_executable (const char *name,
|
|||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_wait_test_process (GSubprocess *subprocess);
|
void meta_wait_test_process (GSubprocess *subprocess);
|
||||||
|
|
||||||
|
META_EXPORT
|
||||||
|
void meta_wait_for_window_cursor (MetaContext *context);
|
||||||
|
Reference in New Issue
Block a user