on xenial help sign in
Test that the dash hswipe is disabled while the inner stuff is moving
305cae0Albert Astals
tests/mocks/Unity/fake_scope.cpp+3−13
@@ -27,18 +27,8 @@ static DeeModel* create_results_model(unsigned category_count, unsigned result_c
27
27
28// TODO: Implement remaining pieces
28// TODO: Implement remaining pieces
29
29
30−Scope::Scope(QObject* parent)
30+Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, 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))
37{
31{
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);
42}
32}
43
33
44Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent)
34Scope::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
51 , m_categories(new Categories(this))
41 , m_categories(new Categories(this))
52 , m_results(new DeeListModel(this))
42 , m_results(new DeeListModel(this))
53{
43{
54− DeeModel* results_model = create_results_model(4, 30);
44+ DeeModel* results_model = create_results_model(20, 300);
55 m_categories->setResultModel(results_model);
45 m_categories->setResultModel(results_model);
56− m_categories->setModel(create_categories_model(4));
46+ m_categories->setModel(create_categories_model(20));
57 m_results->setModel(results_model);
47 m_results->setModel(results_model);
58}
48}
59
49
tests/qmltests/Dash/qml/FakeScopeView.qml+1
@@ -23,6 +23,7 @@ ScopeView {
23 id: fakeScopeView
23 id: fakeScopeView
24
24
25 property alias backColor : back.color
25 property alias backColor : back.color
26+ moving: listView.moving
26
27
27 onEndReached: {
28 onEndReached: {
28 if (shell != undefined && shell.scopeStatus != undefined) {
29 if (shell != undefined && shell.scopeStatus != undefined) {
tests/qmltests/Dash/tst_DashContent.qml+14
@@ -229,5 +229,19 @@ Item {
229 tryCompare(scopesModel.get(1), "isActive", data.active1);
229 tryCompare(scopesModel.get(1), "isActive", data.active1);
230 tryCompare(scopesModel.get(2), "isActive", data.active2);
230 tryCompare(scopesModel.get(2), "isActive", data.active2);
231 }
231 }
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+ }
232 }
246 }
233}
247}