on xenial help sign in
Test that the dash hswipe is disabled while the inner stuff is moving

. Approved by PS Jenkins bot, Andrea Cimitan.

commita99723b8337d2c5062f9680c09ae954267e83bbd authorAlbert Astals <albert.astals@canonical.com> dateFri 8 Nov 2013, 15:14 (13 years ago) parentaebbd117cdc91c
4 files changed+21−20
tests/mocks/Unity/fake_scope.cpp+3−20 tests/qmltests/Dash/qml/FakeScopeView.qml+1 tests/qmltests/Dash/tst_DashContent.qml+14 tests/qmltests/Dash/tst_GenericScopeView.qml+3
tests/mocks/Unity/fake_scope.cpp+3−20
@@ -25,25 +25,8 @@ static DeeModel* create_results_model(unsigned category_count, unsigned result_c
2525
2626// TODO: Implement remaining pieces
2727
28−Scope::Scope(QObject* parent)
29− : QObject(parent)
30− , m_visible(false)
31− , m_searching(false)
32− , m_isActive(false)
33− , m_categories(new Categories(this))
34− , m_results(new DeeListModel(this))
28+Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent)
3529{
36− DeeModel* results_model = create_results_model(4, 30);
37− m_categories->setResultModel(results_model);
38− m_categories->setModel(create_categories_model(4));
39− m_results->setModel(results_model);
40−
41− m_timer.setInterval(1000);
42− m_timer.setSingleShot(true);
43− connect(&m_timer, &QTimer::timeout, [this]() {
44− Preview *p = new Preview(this);
45− Q_EMIT previewReady(p);
46− });
4730}
4831
4932Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent)
@@ -56,9 +39,9 @@ Scope::Scope(QString const& id, QString const& name, bool visible, QObject* pare
5639 , m_categories(new Categories(this))
5740 , m_results(new DeeListModel(this))
5841{
59− DeeModel* results_model = create_results_model(4, 30);
42+ DeeModel* results_model = create_results_model(20, 300);
6043 m_categories->setResultModel(results_model);
61− m_categories->setModel(create_categories_model(4));
44+ m_categories->setModel(create_categories_model(20));
6245 m_results->setModel(results_model);
6346
6447 m_timer.setInterval(1000);
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}
tests/qmltests/Dash/tst_GenericScopeView.qml+3
@@ -74,6 +74,9 @@ Item {
7474 }
7575
7676 function openPreview() {
77+ var categoryListView = findChild(genericScopeView, "categoryListView");
78+ categoryListView.positionAtBeginning();
79+
7780 var tile = findChild(genericScopeView, "delegate0");
7881 mouseClick(tile, tile.width / 2, tile.height / 2);
7982 var openEffect = findChild(genericScopeView, "openEffect");