summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel d'Andrada <daniel.dandrada@canonical.com>2015-02-11 11:09:13 -0200
committerDaniel d'Andrada <daniel.dandrada@canonical.com>2015-02-11 11:09:13 -0200
commitf7fdcfffd0e41f124c296801214b779dae33acb6 (patch)
tree7196b02ed5cc5a950ef23095d070d2b95a2498cc /tests
parentf8af5e80cb420c6162fe9367223a1abb268f2372 (diff)
parent5708bad137836ba767eeb591eb85f3d686cae370 (diff)
Merge trunk
[ Daniel van Vugt ] * QtMir changes required to support the Mir branch of the same name. Landing soon. (LP: #1395581) [ Alan Griffiths ] * Port to the msh::Shell API in Mir [ Robert Carr ] * Bump build-dep to mir 0.11. [ Gerry Boland ] * Explicitly setting GL-mode breaks GTK app rendering. Removing the hack appears to just work (LP: #1401968) [ MichaƂ Sawicz ] * Add moot autopkgtest to run the standard unit tests [ Albert Astals Cid ] * Fix demo shell import name [ Daniel d'Andrada ] * Don't suspend&resume the main stage app when switching focus from side to main stage
Diffstat (limited to 'tests')
-rw-r--r--tests/modules/MirSurfaceItem/mirsurfaceitem_test.cpp2
-rw-r--r--tests/modules/common/mock_focus_controller.h40
-rw-r--r--tests/modules/common/mock_mir_session.h1
-rw-r--r--tests/modules/common/mock_renderable.h2
-rw-r--r--tests/modules/common/mock_surface.h2
-rw-r--r--tests/modules/common/qtmir_test.h3
6 files changed, 6 insertions, 44 deletions
diff --git a/tests/modules/MirSurfaceItem/mirsurfaceitem_test.cpp b/tests/modules/MirSurfaceItem/mirsurfaceitem_test.cpp
index 1e16bf0..9fa237c 100644
--- a/tests/modules/MirSurfaceItem/mirsurfaceitem_test.cpp
+++ b/tests/modules/MirSurfaceItem/mirsurfaceitem_test.cpp
@@ -86,7 +86,7 @@ TEST(MirSurfaceItemTest, MissingTouchEnd)
}));
- MirSurfaceItem *surfaceItem = new MirSurfaceItem(mockSurface, mockSession, nullptr);
+ MirSurfaceItem *surfaceItem = new MirSurfaceItem(mockSurface, mockSession, nullptr, nullptr);
ulong timestamp = 1234;
QList<QTouchEvent::TouchPoint> touchPoints;
diff --git a/tests/modules/common/mock_focus_controller.h b/tests/modules/common/mock_focus_controller.h
deleted file mode 100644
index 5d77b0e..0000000
--- a/tests/modules/common/mock_focus_controller.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2014 Canonical, Ltd.
- *
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU Lesser 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 warranties of MERCHANTABILITY,
- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef MOCK_MIR_SHELL_FOCUS_CONTROLLER_H
-#define MOCK_MIR_SHELL_FOCUS_CONTROLLER_H
-
-#include <mir/shell/focus_controller.h>
-#include <gmock/gmock.h>
-
-#include <string>
-
-namespace mir {
-namespace shell {
-
-class MockFocusController : public FocusController
-{
-public:
- MOCK_METHOD0(focus_next, void());
- MOCK_CONST_METHOD0(focussed_application, std::weak_ptr<scene::Session>());
- MOCK_METHOD1(set_focus_to, void(std::shared_ptr<scene::Session>const&));
-};
-
-} // namespace shell
-} // namespace mir
-
-#endif // MOCK_MIR_SHELL_FOCUS_CONTROLLER_H_
diff --git a/tests/modules/common/mock_mir_session.h b/tests/modules/common/mock_mir_session.h
index e0bd62d..4c8b4b7 100644
--- a/tests/modules/common/mock_mir_session.h
+++ b/tests/modules/common/mock_mir_session.h
@@ -49,6 +49,7 @@ struct MockSession : public Session
MOCK_CONST_METHOD0(default_surface, std::shared_ptr<Surface>());
MOCK_CONST_METHOD1(get_surface, std::shared_ptr<frontend::Surface>(frontend::SurfaceId));
+ MOCK_CONST_METHOD1(surface, std::shared_ptr<scene::Surface>(frontend::SurfaceId));
MOCK_METHOD1(take_snapshot, void(SnapshotCallback const&));
MOCK_METHOD1(set_lifecycle_state, void(MirLifecycleState));
diff --git a/tests/modules/common/mock_renderable.h b/tests/modules/common/mock_renderable.h
index 38b8c6b..853f32a 100644
--- a/tests/modules/common/mock_renderable.h
+++ b/tests/modules/common/mock_renderable.h
@@ -34,9 +34,7 @@ struct MockRenderable : public Renderable
MOCK_CONST_METHOD0(screen_position, geometry::Rectangle());
MOCK_CONST_METHOD0(alpha, float() );
MOCK_CONST_METHOD0(transformation, glm::mat4());
- MOCK_CONST_METHOD0(visible, bool());
MOCK_CONST_METHOD0(shaped, bool());
- MOCK_CONST_METHOD0(buffers_ready_for_compositor, int());
};
} // namespace graphics
diff --git a/tests/modules/common/mock_surface.h b/tests/modules/common/mock_surface.h
index f6d6642..04acce9 100644
--- a/tests/modules/common/mock_surface.h
+++ b/tests/modules/common/mock_surface.h
@@ -36,6 +36,7 @@ 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_METHOD0(parent, std::shared_ptr<Surface>());
std::unique_ptr<graphics::Renderable> compositor_snapshot(void const* /*compositor_id*/) const
{
@@ -64,6 +65,7 @@ struct MockSurface : public mir::scene::Surface
MOCK_CONST_METHOD0(input_channel, std::shared_ptr<input::InputChannel>());
MOCK_METHOD1(set_reception_mode, void(input::InputReceptionMode mode));
MOCK_METHOD0(request_client_surface_close, void());
+ MOCK_CONST_METHOD1(buffers_ready_for_compositor, int(void const*));
// from mir::input::surface
MOCK_CONST_METHOD1(input_area_contains, bool(geometry::Point const& point));
diff --git a/tests/modules/common/qtmir_test.h b/tests/modules/common/qtmir_test.h
index 6f2bc5f..f8e8a89 100644
--- a/tests/modules/common/qtmir_test.h
+++ b/tests/modules/common/qtmir_test.h
@@ -33,7 +33,6 @@
#include "mock_desktop_file_reader.h"
#include "mock_proc_info.h"
#include "mock_mir_session.h"
-#include "mock_focus_controller.h"
#include "mock_prompt_session_manager.h"
#include "mock_prompt_session.h"
#include "mock_shared_wakelock.h"
@@ -111,6 +110,7 @@ public:
}
, surfaceManager{
mirServer,
+ mirShell,
&sessionManager
}
{
@@ -150,6 +150,7 @@ public:
testing::NiceMock<testing::MockDesktopFileReaderFactory> desktopFileReaderFactory;
testing::NiceMock<testing::MockSharedWakelock> sharedWakelock;
QSharedPointer<FakeMirServer> mirServer;
+ MirShell *mirShell{nullptr};
QSharedPointer<TaskController> taskController;
ApplicationManager applicationManager;
SessionManager sessionManager;