~gerboland/unity8/dash-create-dbus-only-after-window

« back to all changes in this revision

Viewing changes to tests/qmltests/Panel/tst_IndicatorsMenu.qml

  • Committer: CI bot
  • Author(s): Daniel d'Andrada
  • Date: 2014-12-02 09:25:56 UTC
  • mfrom: (1450.2.3 fixTestCaseTouchFlick)
  • Revision ID: ps-jenkins@lists.canonical.com-20141202092556-fedlvsdbxmyrz50x
Make UnityTestCase.touchFlick properly map event coordinates

Just like tap() already does. It was working so far just because items
under test were top-left aligned (ie, had x=0 and y=0). 
Approved by: Michael Zanetti

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
        // and expose the header
175
175
        function test_hint() {
176
176
            var indicatorItem = get_indicator_item(0);
177
 
            var mappedPosition = root.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2);
 
177
            var mappedPosition = indicatorsMenu.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2);
178
178
 
179
179
            touchPress(indicatorsMenu, mappedPosition.x, indicatorsMenu.minimizedPanelHeight / 2);
180
180
 
195
195
            for (var i = 0; i < root.originalModelData.length; i++) {
196
196
                var indicatorItem = get_indicator_item(i);
197
197
 
198
 
                var mappedPosition = root.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2);
 
198
                var mappedPosition = indicatorsMenu.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2);
199
199
 
200
200
                touchFlick(indicatorsMenu,
201
201
                           mappedPosition.x, mappedPosition.y,
227
227
 
228
228
            // Get the first indicator
229
229
            var firstItem = get_indicator_item(0);
230
 
            var firstItemMappedPosition = root.mapFromItem(firstItem, firstItem.width/2, firstItem.height/2);
 
230
            var firstItemMappedPosition = indicatorsMenu.mapFromItem(firstItem, firstItem.width/2, firstItem.height/2);
231
231
 
232
232
            // 1) Drag the mouse down to hint a bit
233
233
            touchFlick(indicatorsMenu,