-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from wmww/lock-tests
Session lock tests
- Loading branch information
Showing
62 changed files
with
625 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include "integration-test-common.h" | ||
|
||
static GtkWindow *layer_window; | ||
static GtkWidget *layer_dropdown; | ||
static const char *options[] = {"Foo", "Bar", "Baz", NULL}; | ||
|
||
static void callback_0() { | ||
EXPECT_MESSAGE(zwlr_layer_shell_v1 .get_layer_surface); | ||
|
||
// The popup is weirdly slow to open, so slow the tests down | ||
step_time = 600; | ||
|
||
layer_window = GTK_WINDOW(gtk_window_new()); | ||
layer_dropdown = gtk_drop_down_new_from_strings(options); | ||
gtk_window_set_child(layer_window, layer_dropdown); | ||
gtk_layer_init_for_window(layer_window); | ||
gtk_window_present(layer_window); | ||
} | ||
|
||
static void callback_1() { | ||
EXPECT_MESSAGE(xdg_wm_base .get_xdg_surface); | ||
EXPECT_MESSAGE(xdg_surface .get_popup nil); | ||
EXPECT_MESSAGE(zwlr_layer_surface_v1 .get_popup); | ||
EXPECT_MESSAGE(xdg_popup .grab); | ||
|
||
UNEXPECT_MESSAGE(xdg_popup .destroy); | ||
|
||
g_signal_emit_by_name(layer_dropdown, "activate", NULL); | ||
} | ||
|
||
static void callback_2() { | ||
EXPECT_MESSAGE(xdg_popup .destroy); | ||
EXPECT_MESSAGE(xdg_surface .destroy); | ||
EXPECT_MESSAGE(zwlr_layer_surface_v1 .destroy); | ||
|
||
gtk_window_close(layer_window); | ||
gtk_window_close(layer_window); | ||
} | ||
|
||
TEST_CALLBACKS( | ||
callback_0, | ||
callback_1, | ||
callback_2, | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions
52
test/layer-tests/test-xdg-toplevel-popup-with-layer-surface.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include "integration-test-common.h" | ||
|
||
static GtkWindow *layer_window; | ||
static GtkWindow *normal_window; | ||
static GtkWidget *normal_dropdown; | ||
static const char *options[] = {"Foo", "Bar", "Baz", NULL}; | ||
|
||
static void callback_0() { | ||
EXPECT_MESSAGE(zwlr_layer_shell_v1 .get_layer_surface); | ||
EXPECT_MESSAGE(xdg_wm_base .get_xdg_surface); | ||
EXPECT_MESSAGE(xdg_surface .get_toplevel); | ||
|
||
// The popup is weirdly slow to open, so slow the tests down | ||
step_time = 600; | ||
|
||
layer_window = create_default_window(); | ||
gtk_layer_init_for_window(layer_window); | ||
gtk_window_present(layer_window); | ||
|
||
normal_window = GTK_WINDOW(gtk_window_new()); | ||
normal_dropdown = gtk_drop_down_new_from_strings(options); | ||
gtk_window_set_child(normal_window, normal_dropdown); | ||
gtk_window_present(normal_window); | ||
} | ||
|
||
static void callback_1() { | ||
EXPECT_MESSAGE(xdg_wm_base .get_xdg_surface); | ||
EXPECT_MESSAGE(xdg_surface .get_popup xdg_surface); | ||
EXPECT_MESSAGE(xdg_popup .grab); | ||
|
||
UNEXPECT_MESSAGE(zwlr_layer_surface_v1 .get_popup); | ||
UNEXPECT_MESSAGE(xdg_popup .destroy); | ||
|
||
g_signal_emit_by_name(normal_dropdown, "activate", NULL); | ||
} | ||
|
||
static void callback_2() { | ||
EXPECT_MESSAGE(xdg_popup .destroy); | ||
EXPECT_MESSAGE(xdg_surface .destroy); | ||
EXPECT_MESSAGE(xdg_toplevel .destroy); | ||
EXPECT_MESSAGE(xdg_surface .destroy); | ||
EXPECT_MESSAGE(zwlr_layer_surface_v1 .destroy); | ||
|
||
gtk_window_close(normal_window); | ||
gtk_window_close(layer_window); | ||
} | ||
|
||
TEST_CALLBACKS( | ||
callback_0, | ||
callback_1, | ||
callback_2, | ||
) |
Oops, something went wrong.