~alan-griffiths/mir/revert-c2238

« back to all changes in this revision

Viewing changes to tests/integration-tests/test_client_surface_swap_buffers.cpp

  • Committer: Tarmac
  • Author(s): Alan Griffiths
  • Date: 2015-01-22 11:58:57 UTC
  • mfrom: (2242.1.3 mir3)
  • Revision ID: tarmac-20150122115857-jh60f72v7ii1on92
tests: deduplicate NullDisplayBufferCompositorFactory.

Approved by PS Jenkins bot, Alberto Aguirre, Robert Carr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2014 Canonical Ltd.
3
 
 *
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.
7
 
 *
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.
12
 
 *
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/>.
15
 
 *
16
 
 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17
 
 */
18
 
 
19
 
#include "mir_toolkit/mir_client_library.h"
20
 
 
21
 
#include "mir_test_framework/stubbed_server_configuration.h"
22
 
#include "mir_test_framework/basic_client_server_fixture.h"
23
 
//#include "mir_test_doubles/null_display_buffer_compositor_factory.h"
24
 
#include "mir_test/signal.h"
25
 
 
26
 
#include <gtest/gtest.h>
27
 
 
28
 
namespace mtf = mir_test_framework;
29
 
namespace mt = mir::test;
30
 
//namespace mtd = mir::test::doubles;
31
 
namespace mc = mir::compositor;
32
 
 
33
 
//namespace
34
 
//{
35
 
//
36
 
//struct StubServerConfig : mtf::StubbedServerConfiguration
37
 
//{
38
 
//    auto the_display_buffer_compositor_factory()
39
 
//        -> std::shared_ptr<mc::DisplayBufferCompositorFactory> override
40
 
//    {
41
 
//        return std::make_shared<mtd::NullDisplayBufferCompositorFactory>();
42
 
//    }
43
 
//};
44
 
//
45
 
//void swap_buffers_callback(MirSurface*, void* ctx)
46
 
//{
47
 
//    auto buffers_swapped = static_cast<mt::Signal*>(ctx);
48
 
//    buffers_swapped->raise();
49
 
//}
50
 
//
51
 
//using MirSurfaceSwapBuffersTest = mtf::BasicClientServerFixture<StubServerConfig>;
52
 
//
53
 
//}
54
 
//
55
 
//TEST_F(MirSurfaceSwapBuffersTest, swap_buffers_does_not_block_when_surface_is_not_composited)
56
 
//{
57
 
//    using namespace testing;
58
 
//
59
 
//    MirSurfaceParameters request_params =
60
 
//    {
61
 
//        __PRETTY_FUNCTION__,
62
 
//        640, 480,
63
 
//        mir_pixel_format_abgr_8888,
64
 
//        mir_buffer_usage_hardware,
65
 
//        mir_display_output_id_invalid
66
 
//    };
67
 
//
68
 
//    auto const surface = mir_connection_create_surface_sync(connection, &request_params);
69
 
//    ASSERT_TRUE(mir_surface_is_valid(surface));
70
 
//
71
 
//    for (int i = 0; i < 10; ++i)
72
 
//    {
73
 
//        mt::Signal buffers_swapped;
74
 
//
75
 
//        mir_surface_swap_buffers(surface, swap_buffers_callback, &buffers_swapped);
76
 
//
77
 
//        /*
78
 
//         * ASSERT instead of EXPECT, since if we continue we will block in future
79
 
//         * mir client calls (e.g mir_connection_release).
80
 
//         */
81
 
//        ASSERT_TRUE(buffers_swapped.wait_for(std::chrono::seconds{5}));
82
 
//    }
83
 
//
84
 
//    mir_surface_release_sync(surface);
85
 
//}