diff options
author | Andreas Pokorny <andreas.pokorny@canonical.com> | 2015-06-25 01:08:44 +0200 |
---|---|---|
committer | Andreas Pokorny <andreas.pokorny@canonical.com> | 2015-06-25 01:08:44 +0200 |
commit | e8687c2cd0640ab635ed53a7b951baa9615a2932 (patch) | |
tree | fc0a47d9fdc25eefb46fab432892bdcc8ed85e47 /tests | |
parent | aee914d643adf4994c655cce06998d1dd06d98d6 (diff) |
changes needed for 0.14.0 release
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mirserver/QtEventFeeder/qteventfeeder_test.cpp | 14 | ||||
-rw-r--r-- | tests/modules/common/mock_mir_session.h | 1 | ||||
-rw-r--r-- | tests/modules/common/mock_surface.h | 8 | ||||
-rw-r--r-- | tests/modules/common/stub_scene_surface.h | 10 |
4 files changed, 12 insertions, 21 deletions
diff --git a/tests/mirserver/QtEventFeeder/qteventfeeder_test.cpp b/tests/mirserver/QtEventFeeder/qteventfeeder_test.cpp index 10c0634..8ebf8a4 100644 --- a/tests/mirserver/QtEventFeeder/qteventfeeder_test.cpp +++ b/tests/mirserver/QtEventFeeder/qteventfeeder_test.cpp @@ -118,7 +118,7 @@ TEST_F(QtEventFeederTest, GenerateMissingTouchEnd) Contains(AllOf(HasId(0), IsPressed()))),_)).Times(1); - auto ev1 = mev::make_event(MirInputDeviceId(), 123*1000000, 0); + auto ev1 = mev::make_event(MirInputDeviceId(), std::chrono::milliseconds(123), 0); mev::add_touch(*ev1, 0 /* touch ID */, mir_touch_action_down, mir_touch_tooltype_unknown, 10, 10, 10 /* x, y, pressure */, 1, 1, 10 /* touch major, minor, size */); @@ -143,7 +143,7 @@ TEST_F(QtEventFeederTest, GenerateMissingTouchEnd) ),_)).Times(1); } - auto ev2 = mev::make_event(MirInputDeviceId(), 125*1000000, 0); + auto ev2 = mev::make_event(MirInputDeviceId(), std::chrono::milliseconds(125), 0); mev::add_touch(*ev2, 1 /* touch ID */, mir_touch_action_down, mir_touch_tooltype_unknown, 20, 20, 10 /* x, y, pressure*/, 1, 1, 10 /* touch major, minor, size */); @@ -157,7 +157,7 @@ TEST_F(QtEventFeederTest, GenerateMissingTouchEnd2) setIrrelevantMockWindowSystemExpectations(); - auto ev1 = mev::make_event(MirInputDeviceId(), 123*1000000, 0); + auto ev1 = mev::make_event(MirInputDeviceId(), std::chrono::milliseconds(123), 0); mev::add_touch(*ev1, 0 /* touch ID */, mir_touch_action_down, mir_touch_tooltype_unknown, 10, 10, 10 /* x, y, pressure*/, 1, 1, 10 /* touch major, minor, size */); @@ -173,7 +173,7 @@ TEST_F(QtEventFeederTest, GenerateMissingTouchEnd2) setIrrelevantMockWindowSystemExpectations(); - auto ev2 = mev::make_event(MirInputDeviceId(), 124*1000000, 0); + auto ev2 = mev::make_event(MirInputDeviceId(), std::chrono::milliseconds(124), 0); mev::add_touch(*ev2, 0 /* touch ID */, mir_touch_action_change, mir_touch_tooltype_unknown, 10, 10, 10 /* x, y, pressure*/, 1, 1, 10 /* touch major, minor, size */); @@ -195,7 +195,7 @@ TEST_F(QtEventFeederTest, GenerateMissingTouchEnd2) setIrrelevantMockWindowSystemExpectations(); // touch 0 disappeared and touch 2 got pressed - auto ev3 = mev::make_event(MirInputDeviceId(), 125*1000000, 0); + auto ev3 = mev::make_event(MirInputDeviceId(), std::chrono::milliseconds(125), 0); mev::add_touch(*ev3, 1 /* touch ID */, mir_touch_action_change, mir_touch_tooltype_unknown, 20, 20, 10 /* x, y, pressure*/, 1, 1, 10 /* touch major, minor, size */); @@ -235,7 +235,7 @@ TEST_F(QtEventFeederTest, PressSameTouchTwice) Contains(AllOf(HasId(0), IsPressed()))),_)).Times(1); - auto ev1 = mev::make_event(MirInputDeviceId(), 123*1000000, 0); + auto ev1 = mev::make_event(MirInputDeviceId(), std::chrono::milliseconds(123), 0); mev::add_touch(*ev1, /* touch ID */ 0, mir_touch_action_down, mir_touch_tooltype_unknown, 10, 10, 10, 1, 1, 10); qtEventFeeder->dispatch(*ev1); @@ -248,7 +248,7 @@ TEST_F(QtEventFeederTest, PressSameTouchTwice) Contains(AllOf(HasId(0), StateIsMoved())) ),_)).Times(1); - auto ev2 = mev::make_event(MirInputDeviceId(), 123*1000000, 0); + auto ev2 = mev::make_event(MirInputDeviceId(), std::chrono::milliseconds(123), 0); mev::add_touch(*ev2, /* touch ID */ 0, mir_touch_action_down, mir_touch_tooltype_unknown, 10, 10, 10, 1, 1, 10); qtEventFeeder->dispatch(*ev2); diff --git a/tests/modules/common/mock_mir_session.h b/tests/modules/common/mock_mir_session.h index 1dfa959..ce2339c 100644 --- a/tests/modules/common/mock_mir_session.h +++ b/tests/modules/common/mock_mir_session.h @@ -70,6 +70,7 @@ struct MockSession : public Session MOCK_CONST_METHOD1(get_buffer_stream, std::shared_ptr<frontend::BufferStream>(frontend::BufferStreamId)); MOCK_METHOD1(destroy_buffer_stream, void(frontend::BufferStreamId)); MOCK_METHOD1(create_buffer_stream, frontend::BufferStreamId(graphics::BufferProperties const&)); + void configure_streams(Surface&, std::vector<shell::StreamSpecification> const&) override {}; private: std::string m_sessionName; diff --git a/tests/modules/common/mock_surface.h b/tests/modules/common/mock_surface.h index c660d50..8ded667 100644 --- a/tests/modules/common/mock_surface.h +++ b/tests/modules/common/mock_surface.h @@ -36,12 +36,9 @@ struct MockSurface : public mir::scene::Surface MOCK_CONST_METHOD0(input_bounds, geometry::Rectangle()); MOCK_CONST_METHOD0(top_left, geometry::Point()); MOCK_CONST_METHOD0(size, geometry::Size()); + MOCK_CONST_METHOD1(generate_renderables,graphics::RenderableList(compositor::CompositorID id)); MOCK_CONST_METHOD0(parent, std::shared_ptr<Surface>()); - std::unique_ptr<graphics::Renderable> compositor_snapshot(void const* /*compositor_id*/) const - { - return std::unique_ptr<graphics::Renderable>(new graphics::MockRenderable); - } MOCK_CONST_METHOD0(alpha, float()); MOCK_CONST_METHOD0(type, MirSurfaceType()); @@ -68,6 +65,7 @@ struct MockSurface : public mir::scene::Surface MOCK_CONST_METHOD1(buffers_ready_for_compositor, int(void const*)); void set_keymap(xkb_rule_names const &) override {} void rename(std::string const&) override {} + MOCK_METHOD1(set_streams, void(std::list<StreamInfo> const&)); // from mir::input::surface MOCK_CONST_METHOD1(input_area_contains, bool(geometry::Point const& point)); @@ -82,7 +80,7 @@ struct MockSurface : public mir::scene::Surface MOCK_CONST_METHOD0(client_input_fd, int()); MOCK_METHOD2(configure, int(MirSurfaceAttrib attrib, int value)); MOCK_CONST_METHOD1(query, int(MirSurfaceAttrib attrib)); - + MOCK_CONST_METHOD0(primary_buffer_stream, std::shared_ptr<frontend::BufferStream>()); // from mir::scene::SurfaceBufferAccess MOCK_METHOD1(with_most_recent_buffer_do, void(std::function<void(graphics::Buffer&)> const& exec)); diff --git a/tests/modules/common/stub_scene_surface.h b/tests/modules/common/stub_scene_surface.h index 4765a65..05fcc57 100644 --- a/tests/modules/common/stub_scene_surface.h +++ b/tests/modules/common/stub_scene_surface.h @@ -62,8 +62,7 @@ public: geometry::Rectangle input_bounds() const override { return {{},{}}; } bool input_area_contains(mir::geometry::Point const&) const override { return false; } - virtual std::unique_ptr<graphics::Renderable> compositor_snapshot(void const*) const override { return nullptr; } - + graphics::RenderableList generate_renderables(compositor::CompositorID) const override { return {};} float alpha() const override { return 0.0f;} MirSurfaceType type() const override { return mir_surface_type_normal; } MirSurfaceState state() const override { return mir_surface_state_unknown; } @@ -72,12 +71,10 @@ public: void show() override {} void move_to(geometry::Point const&) override {} void set_input_region(std::vector<geometry::Rectangle> const&) override {} - void allow_framedropping(bool) override {} void resize(geometry::Size const&) override {} void set_transformation(glm::mat4 const&) override {} void set_alpha(float) override {} void set_orientation(MirOrientation) {} - void force_requests_to_complete() override {} void add_observer(std::shared_ptr<scene::SurfaceObserver> const&) override {} void remove_observer(std::weak_ptr<scene::SurfaceObserver> const&) override {} @@ -88,15 +85,10 @@ public: void set_cursor_image(std::shared_ptr<graphics::CursorImage> const& /* image */) {} std::shared_ptr<graphics::CursorImage> cursor_image() const { return {}; } - MirPixelFormat pixel_format() const override { return mir_pixel_format_xrgb_8888; } - - void swap_buffers(graphics::Buffer*, std::function<void(graphics::Buffer*)>) override {} - bool supports_input() const override { return true;} int client_input_fd() const override { return fd;} int configure(MirSurfaceAttrib, int) override { return 0; } int query(MirSurfaceAttrib) const override { return 0; } - void with_most_recent_buffer_do(std::function<void(graphics::Buffer&)> const& ) override {} }; } |