diff options
| author | Andrea Azzarone <azzaronea@gmail.com> | 2014-06-07 16:26:59 +0000 |
|---|---|---|
| committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-06-07 16:26:59 +0000 |
| commit | a5d80fed5eb2210daefc8d66d945acdcdd5929c4 (patch) | |
| tree | b76e789bcbb9e2730090d1fd664a7315e277d0b1 /tests | |
| parent | 231eddcc47df3ad527081598a80dce74da9a36a4 (diff) | |
| parent | f88b36e9b350b759d9ecc2f24352b885070fa997 (diff) | |
Disable switcher gestures if screen is locked. Fixed a regression. Fixes: 1321043
(bzr r3818)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-gestures/LockScreenControllerMock.h | 43 | ||||
| -rw-r--r-- | tests/test-gestures/sed_script_switcher | 2 | ||||
| -rw-r--r-- | tests/test-gestures/unityshell_mock.h | 9 |
3 files changed, 53 insertions, 1 deletions
diff --git a/tests/test-gestures/LockScreenControllerMock.h b/tests/test-gestures/LockScreenControllerMock.h new file mode 100644 index 000000000..72bbb4785 --- /dev/null +++ b/tests/test-gestures/LockScreenControllerMock.h @@ -0,0 +1,43 @@ +// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- +/* + * Copyright (C) 2014 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: Andrea Azzarone <andrea.azzarone@canonical.com> + */ + +#ifndef LOCK_SCREEN_CONTROLLER_MOCK_H +#define LOCK_SCREEN_CONTROLLER_MOCK_H + +#include <memory> + +namespace unity +{ +namespace lockscreen +{ + +class ControllerMock +{ +public: + typedef std::shared_ptr<ControllerMock> Ptr; + + bool IsLocked() { + return false; + } +}; + +} +} + +#endif \ No newline at end of file diff --git a/tests/test-gestures/sed_script_switcher b/tests/test-gestures/sed_script_switcher index edb958c4b..9ddfadcd3 100644 --- a/tests/test-gestures/sed_script_switcher +++ b/tests/test-gestures/sed_script_switcher @@ -19,8 +19,10 @@ s|\<InputArea\>|InputAreaMock|g s|\<Nux/Nux\.h\>|NuxMock.h|g s|\<CompTimer\>|CompTimerMock|g s|\<LauncherController\>|LauncherControllerMock|g +s|\<LockScreenController\>|LockControllerMock|g s|\<SwitcherController\>|SwitcherControllerMock|g s|\<switcher\:\:Controller\>|switcher\:\:ControllerMock|g +s|\<lockscreen\:\:Controller\>|lockscreen\:\:ControllerMock|g s|\<launcher\:\:Controller\>|launcher\:\:ControllerMock|g /SwitcherView\.h/d s|\<SwitcherView\>|SwitcherViewMock|g diff --git a/tests/test-gestures/unityshell_mock.h b/tests/test-gestures/unityshell_mock.h index 36a34c667..9dede694d 100644 --- a/tests/test-gestures/unityshell_mock.h +++ b/tests/test-gestures/unityshell_mock.h @@ -6,7 +6,7 @@ #include <NuxMock.h> #include "SwitcherControllerMock.h" - +#include "LockScreenControllerMock.h" namespace unity { @@ -29,6 +29,7 @@ class UnityScreenMock : public CompScreenMock UnityScreenMock() { switcher_controller_ = std::make_shared<switcher::ControllerMock>(); + lockscreen_controller_ = std::make_shared<lockscreen::ControllerMock>(); Reset(); } @@ -59,7 +60,13 @@ class UnityScreenMock : public CompScreenMock return switcher_controller_; } + lockscreen::ControllerMock::Ptr lockscreen_controller() + { + return lockscreen_controller_; + } + switcher::ControllerMock::Ptr switcher_controller_; + lockscreen::ControllerMock::Ptr lockscreen_controller_; int SetUpAndShowSwitcher_count_; }; |
