~ci-train-bot/mir/mir-ubuntu-zesty-2683

« back to all changes in this revision

Viewing changes to tests/acceptance-tests/test_client_library.cpp

  • Committer: Bileto Bot
  • Date: 2017-04-13 15:26:17 UTC
  • mfrom: (1160.2883.164 0.27)
  • Revision ID: ci-train-bot@canonical.com-20170413152617-bs7slz07xbzxu2d3
* New upstream release 0.27.0 (https://launchpad.net/mir/+milestone/0.27.0)
  - ABI summary:
    . mirclient ABI unchanged at 9
    . mirserver ABI bumped to 44
    . mircommon ABI unchanged at 7
    . mirplatform ABI bumped to 61
    . mirprotobuf ABI unchanged at 3
    . mirplatformgraphics ABI bumped to 13
    . mirclientplatform ABI unchanged at 5
    . mirinputplatform ABI bumped to 7
    . mircore ABI unchanged at 1
  - Enhancements:
    . Mostly groundwork required to support major enhancements coming in
      future Mir versions.
    . Removed android-input and eliminated the entire "3rd_party/" subtree.
      Now the Mir source tree contains original code only.
    . Added mir_prompt_session_new_fds_for_prompt_providers_sync API.
    . mirout: Added load and save options for keeping display configs
      on disk.
    . mirout: Added "--" support for applying configuration changes under
      Unity8.
    . Fixed failure of DRM hardware cursor {hide(); show(image);}
    . Added server option: "--cursor software" (MIR_SERVER_CURSOR=software)
    . Added letterboxing/black bars support to the GL renderer in preparation
      for generic output cloning.
    . Added client API for getting the logical size of an output.
    . Migrated MirCookie to use SHA-256.
    . Ensure RealKMSOutputConfiguration stays in sync with actual hardware
      state.
    . Added support for drag-and-drop.
    . Lots of other client API enhancements.
    . Minor clean-ups, optimizations and dead code removal.
  - Bugs fixed:
    . [enhancement] Make able to get version information from client /
      server APIs (LP: #1195540)
    . Touch screen coordinates don't rotate with the screen (LP: #1349660)
    . Subpixel order not included in Mir display information (LP: #1393578)
    . [enhancement] Missing client API for relative surface movement (e.g.
      dragging client-decorated windows) (LP: #1420334) . Mir does not reset
      key states when paused or resumed (modifiers get stuck after VT
      switching) (LP: #1536279)
    . Inconsistent behaviour of Num Lock (LP: #1588237)
    . [ FAILED ] NestedInput.nested_event_filter_receives_keyboard_from_host
      (LP: #1613523)
    . Rotating an output left or right without restarting the
      compositor distorts the image (LP: #1643488)
    . support display scaling slider in unity8 (LP: #1645372)
    . [ FAILED ] NestedInputWithMouse.mouse_pointer_coordinates_in_nested_
      server_are_accumulated (LP: #1646375)
    . [ FAILED ] NestedInputWithMouse.mouse_pointer_position_is_in_sync_with_
      host_server (LP: #1646558)
    . abi_check doesn't check mircore (LP: #1649354)
    . Under Unity8, mir_demo_client_target is distorted and input in the
      wrong place on start-up (LP: #1655804)
    . [testsfail] PromptSessionClientAPI.client_pid_is_associated_with_
      session hangs and times out (LP: #1655929)
    . EDID does not change when hotplugging a monitor (LP: #1660017)
    . [regression] Mir 0.26.0 - spinner loading animation, minimize, maximize
      too fast (LP: #1661072)
    . [regression] Unity8 stutters constantly (like half frame rate) using
      Mir 0.26.0 (LP: #1661128)
    . [regression] mir_demo_server refuses to quit on Ctrl+Alt+Backspace or
      Ctrl+C in its terminal (deadlock in DefaultInputDeviceHub::add_device)
      (LP: #1661151)
    . [regression] mirout crashes when connecting to unity8 or any nested
      server: [libprotobuf FATAL
      /usr/include/google/protobuf/repeated_field.h:1408] CHECK failed:
      (index) < (current_size_): (LP: #1661163)
    . [ FAILED ] DefaultInputManagerTest.forwards_pause_continue_state_
      changes_to_platform (LP: #1661187)
    . [regression] Segfault on detect_fd_leaks during acceptance tests (in
      DisplayConfiguration/{DisplayFormatSetting,DisplaySubpixelSetting})
      (LP: #1661498)
    . [regression] Nested server segfaults or rapidly logs exceptions when a
      fullscreen client starts [in mir_presentation_chain_set_dropping_mode
      ... std::exception::what: Operation not permitted] (LP: #1661508)
    . [regression] Windowed clients of nested servers are all black
      (LP: #1661521)
    . mir_window_request_persistent_id_sync seg faults when called twice
      (LP: #1661704)
    . mir_acceptance_tests now takes 10 seconds longer (in r4002 compared to
      r4001) (LP: #1662044)
    . Mir graphics platform ABI broke in series 0.26 but sonames never
      changed (LP: #1662455)
    . libmirclient-dev missing build depndency on libmircore-dev
      (LP: #1662942)
    . [regression] mirscreencast hangs during screencast creation
      (LP: #1662997)
    . [regression] Software clients of nested servers with size >=480x480
      are all black in Mir 0.25.0 and later (or stretched and distorted under
      Unity8) (LP: #1663062)
    . mir_window_spec_set_cursor_name() doesn't trigger
      mir::scene::SurfaceObserver::cursor_image_set_to (LP: #1663197)
    . android complaint during mirscreencast of nested server (LP: #1664562)
    . qtubuntu sends wrong text as part of QKeyEvent (LP: #1664610)
    . Mir server crashed with SIGSEGV in
      mir::compositor::TemporaryBuffer::size() called from
      mir::gl::tessellate_renderable_into_rectangle() (LP: #1664760)
    . mirout reports logical size of a rotated display incorrectly
      (LP: #1665271)
    . Nested servers (Unity8) periodically stutter (half frame rate) with
      Mir 0.26.1 (LP: #1666372)
    . If the only surface in a session cannot take focus the server crashes
      (LP: #1667645)
    . [regression] OSK input shaping no longer works correctly (LP: #1669444)
    . GTK window functions `Always on Top, Move and Resize' don't work in
      Mir/Unity8 (LP: #1669524)
    . [regression] mir_proving_server mode hotkeys (Ctrl+Alt+=/-) cause the
      server to segfault (LP: #1669752)
    . Test takes minutes to complete: MediatingDisplayChangerTest.confirmed_
      configuration_doesnt_revert_after_timeout (LP: #1671033)
    . [ FAILED ] PosixRWMutex.prefer_writer_nonrecursive_prevents_writer_
      starvation (Timeout waiting to acquire write lock) (LP: #1671037)
    . [regression] Mixing screen rotation with mode changes makes the image
      squished (LP: #1672269)
    . unity-system-compositor crashed with SIGSEGV in
      libinput_device_config_accel_is_available() from
      libinput_device_config_accel_set_speed() from
      mir::input::evdev::LibInputDevice::apply_settings() (LP: #1672955)
    . Presentation chains should support various Vulkan presentation modes
      (LP: #1673533)
    . Need an extension for GBM buffers to replace
      mir_buffer_get_buffer_package() (LP: #1673534)
    . cross-compile-chroot.sh (to zesty) fails to build [cannot find -ludev]
      due to libudev.so being in a different directory to where libudev.pc
      searches for it (LP: #1674201)
    . Please transition to Boost 1.62 (LP: #1675138)
    . [regression] Mir is assigning the first output ID = 0 (==
      mir_display_output_id_invalid) (LP: #1675331)
    . Mir sending key repeat events continually to nested shell after VT
      switch (causes Unity8 lockup for a while) (LP: #1675357)
    . mirout commands don't work when followed by -- (LP: #1676320)
    . mir_demo_standalone_render_overlays fails to link (LP: #1677239)
    . [regression] doxygen processing for capnproto/protobuf broken
      (LP: #1679248)
    . mir_window_spec_set_cursor_render_surface does not work (LP: #1679836)

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
{
47
47
#pragma GCC diagnostic push
48
48
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
49
 
49
50
// Assert our MirSurfaceType is 1to1 to MirWindowType
50
51
static_assert(
51
52
    static_cast<int32_t>(mir_surface_type_normal) ==
151
152
    "mir_surface_visibility_exposed != mir_window_visibility_exposed");
152
153
static_assert(sizeof(MirSurfaceVisibility) == sizeof(MirWindowVisibility),
153
154
    "sizeof(MirSurfaceVisibility) != sizeof(MirWindowVisibility)");
154
 
#pragma GCC diagnostic pop
155
155
 
156
156
struct ClientLibrary : mtf::HeadlessInProcessServer
157
157
{
239
239
    {
240
240
        for (int i = 0; i < 10; i++)
241
241
        {
242
 
#pragma GCC diagnostic push
243
 
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
244
242
            mir_wait_for_one(mir_surface_set_state(surf,
245
243
                                            mir_surface_state_maximized));
246
244
            mir_wait_for_one(mir_surface_set_state(surf,
249
247
                                            mir_surface_state_fullscreen));
250
248
            mir_wait_for_one(mir_surface_set_state(surf,
251
249
                                            mir_surface_state_minimized));
252
 
#pragma GCC diagnostic pop
253
250
        }
254
251
    }
255
252
};
263
260
{
264
261
    MirWaitHandle* wh = mir_connect(new_connection().c_str(), __PRETTY_FUNCTION__, connection_callback, this);
265
262
    EXPECT_THAT(wh, NotNull());
266
 
#pragma GCC diagnostic push
267
 
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
263
 
 
264
 
268
265
    mir_wait_for(wh);
269
 
#pragma GCC diagnostic pop
 
266
 
270
267
 
271
268
    ASSERT_THAT(connection, NotNull());
272
269
    EXPECT_TRUE(mir_connection_is_valid(connection));
349
346
 
350
347
TEST_F(ClientLibrary, creates_surface)
351
348
{
352
 
#pragma GCC diagnostic push
353
 
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
354
349
    mir_wait_for(mir_connect(new_connection().c_str(), __PRETTY_FUNCTION__, connection_callback, this));
355
 
#pragma GCC diagnostic pop
356
350
 
357
351
    int request_width = 640, request_height = 480;
358
352
    MirPixelFormat request_format = mir_pixel_format_abgr_8888;
407
401
 
408
402
    EXPECT_THAT(mir_window_get_state(window), Eq(mir_window_state_restored));
409
403
 
410
 
#pragma GCC diagnostic push
411
 
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
412
404
    mir_wait_for(mir_surface_set_state(window, mir_surface_state_fullscreen));
413
405
    EXPECT_THAT(mir_surface_get_state(window), Eq(mir_surface_state_fullscreen));
414
406
 
429
421
        mir_wait_for(mir_surface_set_state(window, mir_surface_state_fullscreen));
430
422
        ASSERT_THAT(mir_surface_get_state(window), Eq(mir_surface_state_fullscreen));
431
423
    }
432
 
#pragma GCC diagnostic pop
433
424
 
434
425
    mir_window_release_sync(window);
435
426
    mir_connection_release(connection);
443
434
    auto const format = mir_pixel_format_abgr_8888;
444
435
    auto const spec = mir_create_normal_window_spec(connection, width, height);
445
436
    mir_window_spec_set_pixel_format(spec, format);
 
437
 
446
438
    mir_window_spec_set_pointer_confinement(spec, mir_pointer_confined_to_window);
447
439
    window = mir_create_window_sync(spec);
448
440
    mir_window_spec_release(spec);
594
586
    window = mir_create_window_sync(spec);
595
587
 
596
588
    MirNativeBuffer *native;
 
589
 
597
590
    auto bs = mir_window_get_buffer_stream(window);
598
591
    mir_buffer_stream_get_current_buffer(bs, &native);
 
592
 
599
593
    EXPECT_TRUE(native->flags & mir_buffer_flag_can_scanout);
600
594
    mir_buffer_stream_swap_buffers_sync(bs);
601
595
    EXPECT_TRUE(native->flags & mir_buffer_flag_can_scanout);
605
599
    mir_window_spec_set_height(spec, 100);
606
600
 
607
601
    window = mir_create_window_sync(spec);
 
602
 
608
603
    bs = mir_window_get_buffer_stream(window);
609
604
    mir_buffer_stream_get_current_buffer(bs, &native);
 
605
 
610
606
    EXPECT_FALSE(native->flags & mir_buffer_flag_can_scanout);
611
607
    mir_buffer_stream_swap_buffers_sync(bs);
612
608
    EXPECT_FALSE(native->flags & mir_buffer_flag_can_scanout);
613
609
    mir_window_release_sync(window);
614
610
 
615
 
 
616
611
    mir_window_spec_set_width(spec, 800);
617
612
    mir_window_spec_set_height(spec, 600);
 
613
 
618
614
    mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);
619
615
 
620
616
    window = mir_create_window_sync(spec);
 
617
 
621
618
    bs = mir_window_get_buffer_stream(window);
622
619
    mir_buffer_stream_get_current_buffer(bs, &native);
 
620
 
623
621
    EXPECT_FALSE(native->flags & mir_buffer_flag_can_scanout);
624
622
    mir_buffer_stream_swap_buffers_sync(bs);
625
623
    EXPECT_FALSE(native->flags & mir_buffer_flag_can_scanout);
630
628
    window = mir_create_window_sync(spec);
631
629
    bs = mir_window_get_buffer_stream(window);
632
630
    mir_buffer_stream_get_current_buffer(bs, &native);
 
631
 
633
632
    EXPECT_TRUE(native->flags & mir_buffer_flag_can_scanout);
634
633
    mir_buffer_stream_swap_buffers_sync(bs);
635
634
    EXPECT_TRUE(native->flags & mir_buffer_flag_can_scanout);
661
660
        mir_window_spec_set_height(spec, size.height);
662
661
 
663
662
        window = mir_create_window_sync(spec);
 
663
 
664
664
        auto bs = mir_window_get_buffer_stream(window);
665
665
 
666
666
        MirNativeBuffer *native = NULL;
687
687
    int const n_surfaces = 13;
688
688
    size_t old_surface_count = 0;
689
689
 
690
 
#pragma GCC diagnostic push
691
 
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
692
690
    mir_wait_for(mir_connect(new_connection().c_str(), __PRETTY_FUNCTION__, connection_callback, this));
693
 
#pragma GCC diagnostic pop
694
691
 
695
692
    auto const spec =
696
693
        mir_create_normal_window_spec(connection, 640, 480);
697
694
    mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
698
695
 
699
696
    mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);
 
697
 
700
698
    for (int i = 0; i != n_surfaces; ++i)
701
699
    {
702
700
        old_surface_count = current_surface_count();
725
723
 
726
724
TEST_F(ClientLibrary, client_library_accesses_and_advances_buffers)
727
725
{
728
 
#pragma GCC diagnostic push
729
 
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
730
726
    mir_wait_for(mir_connect(new_connection().c_str(), __PRETTY_FUNCTION__, connection_callback, this));
731
 
#pragma GCC diagnostic pop
732
727
 
733
728
    window = mtf::make_any_surface(connection);
734
729
 
735
730
    buffers = 0;
736
 
#pragma GCC diagnostic push
737
 
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
731
 
738
732
    mir_wait_for(mir_buffer_stream_swap_buffers(mir_window_get_buffer_stream(window), swap_buffers_callback, this));
739
 
#pragma GCC diagnostic pop
 
733
 
740
734
    EXPECT_THAT(buffers, Eq(1));
741
735
 
742
736
    mir_window_release(window, release_surface_callback, this);
754
748
    window = mtf::make_any_surface(connection);
755
749
 
756
750
    mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window));
 
751
 
757
752
    EXPECT_TRUE(mir_window_is_valid(window));
758
753
    EXPECT_STREQ(mir_window_get_error_message(window), "");
759
754
 
790
785
TEST_F(ClientLibrary, accesses_platform_package)
791
786
{
792
787
    using namespace testing;
793
 
#pragma GCC diagnostic push
794
 
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
788
 
795
789
    mir_wait_for(mir_connect(new_connection().c_str(), __PRETTY_FUNCTION__, connection_callback, this));
796
 
#pragma GCC diagnostic pop
797
790
 
798
791
    MirPlatformPackage platform_package;
799
792
    ::memset(&platform_package, -1, sizeof(platform_package));
800
793
 
801
 
#pragma GCC diagnostic push
802
 
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
803
794
    mir_connection_get_platform(connection, &platform_package);
804
 
#pragma GCC diagnostic pop
 
795
 
805
796
    EXPECT_THAT(platform_package, mtf::IsStubPlatformPackage());
806
797
 
807
798
    mir_connection_release(connection);
809
800
 
810
801
TEST_F(ClientLibrary, accesses_display_info)
811
802
{
812
 
#pragma GCC diagnostic push
813
 
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
814
803
    mir_wait_for(mir_connect(new_connection().c_str(), __PRETTY_FUNCTION__, connection_callback, this));
815
 
#pragma GCC diagnostic pop
816
804
 
817
805
    auto configuration = mir_connection_create_display_configuration(connection);
818
806
    ASSERT_THAT(configuration, NotNull());
836
824
 
837
825
TEST_F(ClientLibrary, MultiSurfaceClientTracksBufferFdsCorrectly)
838
826
{
839
 
#pragma GCC diagnostic push
840
 
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
841
827
    mir_wait_for(mir_connect(new_connection().c_str(), __PRETTY_FUNCTION__, connection_callback, this));
842
 
#pragma GCC diagnostic pop
843
828
 
844
829
    auto const surf_one = mtf::make_any_surface(connection);
845
830
    auto const surf_two = mtf::make_any_surface(connection);
901
886
    int const width{800}, height{600};
902
887
    MirPixelFormat const format{mir_pixel_format_bgr_888};
903
888
    auto surface_spec = mir_create_normal_window_spec(connection, width, height);
 
889
 
904
890
    mir_window_spec_set_pixel_format(surface_spec, format);
905
891
 
906
892
    auto window = mir_create_window_sync(surface_spec);
927
913
    int const width{800}, height{600};
928
914
    MirPixelFormat const format{mir_pixel_format_xbgr_8888};
929
915
    auto surface_spec = mir_create_normal_window_spec(connection, width, height);
 
916
 
930
917
    mir_window_spec_set_pixel_format(surface_spec, format);
931
918
 
932
919
    window = mir_create_window_sync(surface_spec);
935
922
    EXPECT_THAT(window, IsValid());
936
923
 
937
924
    MirNativeBuffer* native_buffer;
 
925
 
938
926
    mir_buffer_stream_get_current_buffer(
939
927
        mir_window_get_buffer_stream(window), &native_buffer);
940
928
 
1120
1108
    mir_connection_release(connection);
1121
1109
}
1122
1110
 
1123
 
#pragma GCC diagnostic push
1124
 
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
1111
 
 
1112
 
1125
1113
TEST_F(ClientLibrary, can_get_persistent_surface_id)
1126
1114
{
1127
1115
    auto connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
1183
1171
    mir_connection_release(first_client);
1184
1172
    mir_connection_release(im_client);
1185
1173
}
1186
 
#pragma GCC diagnostic pop
 
1174
 
1187
1175
 
1188
1176
//lp:1661704
1189
1177
TEST_F(ClientLibrary, can_get_window_id_more_than_once_in_quick_succession)
1225
1213
    mir_buffer_stream_release_sync(stream);
1226
1214
    mir_connection_release(connection);
1227
1215
}
 
1216
 
 
1217
TEST_F(ClientLibrary, client_api_version)
 
1218
{
 
1219
    ASSERT_TRUE( MIR_VERSION_NUMBER(MIR_CLIENT_API_VERSION_MAJOR,
 
1220
                                    MIR_CLIENT_API_VERSION_MINOR,
 
1221
                                    MIR_CLIENT_API_VERSION_PATCH) == mir_get_client_api_version());
 
1222
}
 
1223
#pragma GCC diagnostic pop