1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
/*
* Copyright © 2019 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: William Wold <william.wold@canonical.com>
*/
#include "helpers.h"
#include "in_process_server.h"
#include "version_specifier.h"
#include <gmock/gmock.h>
#include <memory>
using namespace testing;
using namespace wlcs;
using WlOutputTest = wlcs::InProcessServer;
TEST_F(WlOutputTest, wl_output_properties_set)
{
wlcs::Client client{the_server()};
ASSERT_THAT(client.output_count(), Ge(1u));
auto output = client.output_state(0);
EXPECT_THAT((bool)output.geometry_position, Eq(true));
EXPECT_THAT((bool)output.mode_size, Eq(true));
EXPECT_THAT((bool)output.scale, Eq(true));
}
TEST_F(WlOutputTest, wl_output_release)
{
wlcs::Client client{the_server()};
{
// Acquire *any* wl_output; we don't care which
auto const output =
client.bind_if_supported<wl_output>(wlcs::AtLeastVersion{WL_OUTPUT_RELEASE_SINCE_VERSION});
client.roundtrip();
}
// output is now released
client.roundtrip();
}
|