2
* Copyright © 2014 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3,
6
* as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
19
#include "mir_toolkit/mir_client_library.h"
21
#include "mir_test_framework/stubbed_server_configuration.h"
22
#include "mir_test_framework/basic_client_server_fixture.h"
24
#include <gtest/gtest.h>
25
#include <gmock/gmock.h>
27
namespace mtf = mir_test_framework;
28
namespace geom = mir::geometry;
33
struct NoOutputsServerConfig : mtf::StubbedServerConfiguration
35
NoOutputsServerConfig()
36
: mtf::StubbedServerConfiguration(std::vector<geom::Rectangle>{})
41
using ServerWithoutActiveOutputs = mtf::BasicClientServerFixture<NoOutputsServerConfig>;
45
TEST_F(ServerWithoutActiveOutputs, creates_valid_client_surface)
47
using namespace testing;
49
MirSurfaceParameters const request_params =
53
mir_pixel_format_abgr_8888,
54
mir_buffer_usage_hardware,
55
mir_display_output_id_invalid
58
auto const surface = mir_connection_create_surface_sync(connection, &request_params);
60
EXPECT_THAT(mir_surface_is_valid(surface), Eq(mir_true))
61
<< mir_surface_get_error_message(surface);
63
mir_surface_release_sync(surface);