on xenial help sign in
Test that the dash hswipe is disabled while the inner stuff is moving
commit305cae077c8a71fa210ad2bfb6d8a8fd56b10941 authorAlbert Astals <albert.astals@canonical.com> dateThu 31 Oct 2013, 11:41 (13 years ago) parentea02059
3 files changed+18−13
tests/mocks/Unity/fake_scope.cpp+3−13 tests/qmltests/Dash/qml/FakeScopeView.qml+1 tests/qmltests/Dash/tst_DashContent.qml+14
tests/mocks/Unity/fake_scope.cpp+3−13
@@ -27,18 +27,8 @@ static DeeModel* create_results_model(unsigned category_count, unsigned result_c
2727
2828// TODO: Implement remaining pieces
2929
30−Scope::Scope(QObject* parent)
31− : QObject(parent)
32− , m_visible(false)
33− , m_searching(false)
34− , m_isActive(false)
35− , m_categories(new Categories(this))
36− , m_results(new DeeListModel(this))
30+Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent)
3731{
38− DeeModel* results_model = create_results_model(4, 30);
39− m_categories->setResultModel(results_model);
40− m_categories->setModel(create_categories_model(4));
41− m_results->setModel(results_model);
4232}
4333
4434Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent)
@@ -51,9 +41,9 @@ Scope::Scope(QString const& id, QString const& name, bool visible, QObject* pare
5141 , m_categories(new Categories(this))
5242 , m_results(new DeeListModel(this))
5343{
54− DeeModel* results_model = create_results_model(4, 30);
44+ DeeModel* results_model = create_results_model(20, 300);
5545 m_categories->setResultModel(results_model);
56− m_categories->setModel(create_categories_model(4));
46+ m_categories->setModel(create_categories_model(20));
5747 m_results->setModel(results_model);
5848}
5949
tests/qmltests/Dash/qml/FakeScopeView.qml+1
@@ -23,6 +23,7 @@ ScopeView {
2323 id: fakeScopeView
2424
2525 property alias backColor : back.color
26+ moving: listView.moving
2627
2728 onEndReached: {
2829 if (shell != undefined && shell.scopeStatus != undefined) {
tests/qmltests/Dash/tst_DashContent.qml+14
@@ -229,5 +229,19 @@ Item {
229229 tryCompare(scopesModel.get(1), "isActive", data.active1);
230230 tryCompare(scopesModel.get(2), "isActive", data.active2);
231231 }
232+
233+ function test_hswipe_disabled_vswipe() {
234+ var dashContentList = findChild(dashContent, "dashContentList");
235+
236+ tryCompare(dashContentList, "interactive", true);
237+
238+ var startX = dashContentList.width/2;
239+ var startY = dashContentList.height/2;
240+ touchFlick(dashContentList, startX, startY, startX, startY - units.gu(800));
241+
242+ tryCompare(dashContentList.currentItem, "moving", true);
243+
244+ compare(dashContentList.interactive, false);
245+ }
232246 }
233247}