File: xdg_output_v1.cpp

package info (click to toggle)
wlcs 1.8.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,528 kB
  • sloc: cpp: 14,211; xml: 7,744; ansic: 952; sh: 164; makefile: 33
file content (43 lines) | stat: -rw-r--r-- 1,353 bytes parent folder | download | duplicates (4)
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
/*
 * 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 "in_process_server.h"
#include "xdg_output_v1.h"

#include <gmock/gmock.h>

using namespace testing;
using namespace wlcs;

using XdgOutputV1Test = wlcs::InProcessServer;

TEST_F(XdgOutputV1Test, xdg_output_properties_set)
{
    Client client{the_server()};
    ASSERT_THAT(client.output_count(), Ge(1u));

    XdgOutputManagerV1 xdg_output_manager{client};
    XdgOutputV1 xdg_output{xdg_output_manager, 0};
    client.roundtrip();

    auto const& state = xdg_output.state();
    ASSERT_THAT((bool)state.logical_position, true);
    ASSERT_THAT((bool)state.logical_size, true);
    ASSERT_THAT((bool)state.name, true);
    // Description is optional
}