45
#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 24, 0)
46
45
TEST_F(WindowId, server_can_identify_window_specified_by_client)
48
47
char const* const test_name = __PRETTY_FUNCTION__;
49
48
using namespace mir::client;
51
50
auto const connection = connect_client(test_name);
52
auto const spec = WindowSpec::for_normal_window(connection, 50, 50, mir_pixel_format_argb_8888)
51
auto const spec = WindowSpec::for_normal_window(connection, 50, 50)
53
52
.set_name(test_name);
55
54
Window const surface{spec.create_window()};
71
70
using namespace mir::client;
73
72
auto const connection = connect_client(test_name);
74
auto const spec = WindowSpec::for_normal_window(connection, 50, 50, mir_pixel_format_argb_8888)
73
auto const spec = WindowSpec::for_normal_window(connection, 50, 50)
75
74
.set_name(test_name);
77
76
Window const surface{spec.create_window()};
86
85
ASSERT_THAT(client_surface_id.c_str(), Eq(id));
90
TEST_F(WindowId, server_fails_gracefully_to_identify_window_specified_by_client)
92
char const* const test_name = __PRETTY_FUNCTION__;
93
using namespace mir::client;
95
auto const connection = connect_client(test_name);
96
auto const spec = WindowSpec::for_normal_window(connection, 50, 50, mir_pixel_format_argb_8888)
99
Window const surface{spec.create_window()};
101
mir::client::WindowId client_surface_id{surface};
103
invoke_tools([&](miral::WindowManagerTools& tools)
105
EXPECT_THROW(tools.info_for_window_id(client_surface_id.c_str()), std::runtime_error);
109
TEST_F(WindowId, server_fails_gracefully_to_return_id_for_window)
111
char const* const test_name = __PRETTY_FUNCTION__;
112
using namespace mir::client;
114
auto const connection = connect_client(test_name);
115
auto const spec = WindowSpec::for_normal_window(connection, 50, 50, mir_pixel_format_argb_8888)
116
.set_name(test_name);
118
Window const surface{spec.create_window()};
120
mir::client::WindowId client_surface_id{surface};
122
invoke_tools([&](miral::WindowManagerTools& tools)
124
auto window = get_first_window(tools);
125
EXPECT_THROW(tools.id_for_window(window), std::runtime_error);
130
89
TEST_F(WindowId, server_fails_gracefully_to_identify_window_from_garbage_id)
133
92
using namespace mir::client;
135
94
auto const connection = connect_client(test_name);
136
auto const spec = WindowSpec::for_normal_window(connection, 50, 50, mir_pixel_format_argb_8888)
137
.set_name(test_name);
95
auto const spec = WindowSpec::for_normal_window(connection, 50, 50).set_name(test_name);
139
97
Window const surface{spec.create_window()};