~paulliu/unity8/zoomImage

« back to all changes in this revision

Viewing changes to tests/autopilot/unity8/shell/emulators/dash.py

  • Committer: Ying-Chun Liu
  • Date: 2014-04-22 15:33:24 UTC
  • mfrom: (734.1.119 unity8)
  • Revision ID: paul.liu@canonical.com-20140422153324-9o7r3gh3dzczx4sr
Merge upstream
[ Albert Astals ]
* Fix last item X position Fixes clicking on the last item sometimes
  not working (LP: #1301871)
* Use upstart in ./run Makes it so that you can use the lock button on
  the device without getting that nasty hwc crash
* Remove AnimationControllerWithSignals.
* Use the correct delegate base item for the Carousel test
* Some simplification in DashContent Kill the ScopeDelegateMapper in
  favour of a simple if (that will eventually go away). Removal of all
  the fake scopes in the tests that added nothing of value to the
  tests. Removal of movementEnded signal that was unused. Removal of
  movementStarted and positionedAtBeginning signals that were being
  used as function calls. Rework DashContent tests so they what the
  function does what it is supposed to do instead of just making sure
  QML signals work .
* Improve Card creation time by adding loaders that make sure only
  what's needed is loaded In my computer it goes from RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtSubtitleMascotSummaryMode
  l": 3.217 msecs per iteration (total: 3,218, iterations: 1000)
  RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtSubtitleMascotModel":
  1.647 msecs per iteration (total: 1,648, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtSubtitleModel": 1.514
  msecs per iteration (total: 1,515, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtModel": 1.471 msecs per
  iteration (total: 1,471, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardArtModel": 1.447 msecs per
  iteration (total: 1,448, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardTitleModel": 1.276 msecs per
  iteration (total: 1,276, iterations: 1000) to RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtSubtitleMascotSummaryMode
  l": 2.916 msecs per iteration (total: 2,917, iterations: 1000)
  RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtSubtitleMascotModel":
  1.504 msecs per iteration (total: 1,504, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtSubtitleModel": 1.060
  msecs per iteration (total: 1,061, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtModel": 1.052 msecs per
  iteration (total: 1,053, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardArtModel": 0.727 msecs per
  iteration (total: 728, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardTitleModel": 0.817 msecs per
  iteration (total: 818, iterations: 1000) (LP: #1297197)
[ Allan LeSage ]
* DashApps emulator get_applications should return a list ordered by
  visible y, x.
[ Andrea Cimitan ]
* Workaround for lp1301309 until fixes for palette in ui toolkit (LP:
  #1301309)
[ Leo Arias ]
* Reverted the change that returns application cards instead of
  titles.
[ Nick Dedekind ]
* Indicator services started by unity8 upstart configuration rather
  than manual emmision from indicator manager.
[ Mirco Müller ]
* Fix notification ap-test assertions.
[ Michael Terry ]
* Use new tablet and phone backgrounds from Design.
[ Michael Zanetti ]
* workaround the QTestLogger assertion issue with make tryXyz and our
  custom uqmlscene
[ Michael Terry ]
* When an application requests focus, handle it in Shell.qml by hiding
  the greeter and stopping any edge demo. (LP: #1227753)
[ Leo Arias ]
* Use subprocess.check_call when caling url-dispatcher, so an error
  will be raised if it fails.
* Test application life cycle with fake apps, instead of messaging and
  address book.
[ Didier Roche ]
* Resync trunk with previous revert upload
[ Michał Sawicz ]
* Set the Qt.ImhNoPredictiveText flag on wifi password field, fixes
  lp:1291575 (LP: #1291575)
[ Albert Astals ]
* Take into account the originY when specifying the delegate ranges
  Fixes bug #1300302 (LP: #1300302)
[ CI bot ]
* Resync trunk
[ Allan LeSage ]
* Swiping open an indicator must show its correct title--protect
  against lp:1253804 . (LP: #1253804)
[ Alexander Sack ]
* Fix TypeError: issue seen in system_integration autopilot test on
  image 279. (LP: #1303685)
[ Bill Filler ]
* Set the Qt.ImhNoPredictiveText flag on wifi password field, fixes
  lp:1291575 (LP: #1291575)
[ Leo Arias ]
* Added a search autopilot helper.
[ Michael Terry ]
* Provide a all-in-one script for getting a device to an unlocked
  state.
* Revert to previous version as it's linked to latest sdk change which
  is making gallery-app AP tests failing on the CI dashboard
[ Albert Astals ]
* Adapt to new TabBar
[ Michael Terry ]
* Re-enable test_networkmanager_integration autopilot test on phone
  platforms
[ CI bot ]
* Resync trunk
[ Leo Arias ]
* Reverted the open_preview autopilot helper to return a Preview
  object.
[ Albert Astals ]
* If not running in Mir load the "fake" application manager (LP:
  #1301547)
* Remove unused properties from DashRenderer
[ Michael Zanetti ]
* Fix tests after right edge merge. Drop old stages tests. Fix right
  edge tests if someone doesn't have the GRID_UNIT_PX exported. make
  GenericScopeView test more robust that broke because the ordering
  changed
* add "make xvfbtestSomething" target to run qml tests in xvfb
* make the "make test" commit hook work again
[ Michał Sawicz ]
* Bump version to ensure incompatibility with previous Unity.Application
  implementations.
* We'll only have the unity-mir and mock Ubuntu.Application plugins
  now, no need for mangling the import paths.
[ Michal Hruby ]
* Remove the albumart image provider. (LP: #1262711)
* Don't reset search string after 2 seconds. (LP: #1297246)
[ James Henstridge ]
* Remove the albumart image provider. (LP: #1262711)
[ Albert Astals ]
* Carousel: Add test to make sure we only create the needed delegates
  and not more
* LVWPH: Remove processEvents() call from updatePolish() It causes
  some reentrancy issues and in some times you end up in polishItems()
  with items that have been deleted because you called processEvents()
  This means i need a small tweak in itemGeometryChanged to not
  reposition items if we are inside a setContentHeight call and two
  small tweaks to tests since now things happen in a different order
  and numbers are different (though equivalent) (LP: #1297240)
* Card.qml binding loops are gone. hooray \o/ Also made the aspect
  properties readonly
[ Mirco Müller ]
* A potential fix for "Cannot read property 'state' of null"-failure
  on Jenkins with the VisualSnapDecisionsQueue QML-test of
  notifications.
[ Michael Terry ]
* Pass user's preference for auto-brightness on to powerd. (LP:
  #1273174)
[ Michael Zanetti ]
* Registers a dummy QObject as QTestRootObject in uqmlscene in order
  to fix make trySomething with Qt 5.2.
* For now, have libunity-private depending on libunity-core-6.0-9 as the
  gsettings schema is here. The dependency wasn't direct and dropped from
  Touch image #271. Consequently, unity8 didn't start (gsettings
  segfaulting).
  Proper strategy will be to include the schema in another package to only
  pull it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from autopilot import logging as autopilot_logging
25
25
from autopilot.introspection import dbus
 
26
from testtools.matchers import MatchesAny, Equals
 
27
from ubuntuuitoolkit import emulators as toolkit_emulators
26
28
 
27
29
 
28
30
logger = logging.getLogger(__name__)
80
82
                'No scope found with id {0}'.format(scope_id))
81
83
 
82
84
    def _get_scope_from_loader(self, loader):
83
 
        if loader.scopeId == 'clickscope':
84
 
            return loader.select_single(DashApps)
85
 
        else:
86
 
            return loader.select_single(GenericScopeView)
 
85
        return loader.get_children()[0]
87
86
 
88
87
    def _open_scope_scrolling(self, scope_loader):
89
88
        scroll = self._get_scroll_direction(scope_loader)
135
134
        self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
136
135
        self.dash_content_list.currentIndex.wait_for(original_index + 1)
137
136
 
 
137
    def enter_search_query(self, query):
 
138
        search_text_field = self._get_search_text_field()
 
139
        search_text_field.write(query)
 
140
        search_text_field.state.wait_for('idle')
 
141
 
 
142
    def _get_search_text_field(self):
 
143
        page_header = self._get_page_header()
 
144
        search_container = page_header.select_single(
 
145
            'QQuickItem', objectName='searchContainer')
 
146
        search_container.state.wait_for(
 
147
            MatchesAny(Equals('narrowActive'), Equals('active')))
 
148
        return search_container.select_single(toolkit_emulators.TextField)
 
149
 
138
150
 
139
151
class GenericScopeView(emulators.UnityEmulatorBase):
140
152
    """Autopilot emulator for generic scopes."""
145
157
 
146
158
        :parameter category: The name of the category where the application is.
147
159
        :app_name: The name of the application.
 
160
        :return: The opened preview.
148
161
 
149
162
        """
150
163
        category_element = self._get_category_element(category)
153
166
        # Some categories do not show previews, like recent apps.
154
167
        # --elopio - 2014-1-14
155
168
        self.pointing_device.click_object(icon)
156
 
        return self.get_root_instance().wait_select_single(
 
169
        preview_list = self.get_root_instance().wait_select_single(
157
170
            'PreviewListView', objectName='dashContentPreviewList')
 
171
        preview_list.x.wait_for(0)
 
172
        return preview_list.select_single(
 
173
            Preview, objectName='preview{}'.format(preview_list.currentIndex))
158
174
 
159
175
    def _get_category_element(self, category):
160
176
        try:
175
191
 
176
192
        """
177
193
        category_element = self._get_category_element(category)
178
 
        application_tiles = category_element.select_many('Card')
179
 
        # TODO return them on the same order they are displayed.
180
 
        # --elopio - 2014-1-15
 
194
        application_cards = category_element.select_many('Card')
 
195
 
 
196
        # sort by y, x
 
197
        application_cards = sorted(
 
198
            application_cards,
 
199
            key=lambda card: (card.globalRect.y, card.globalRect.x))
 
200
 
181
201
        result = []
182
 
        for card in application_tiles:
 
202
        for card in application_cards:
183
203
            if card.objectName != 'cardToolCard':
184
 
                result.append(card)
 
204
                card_header = card.select_single('CardHeader')
 
205
                result.append(card_header.title)
185
206
        return result
 
207
 
 
208
 
 
209
class Preview(emulators.UnityEmulatorBase):
 
210
    """Autopilot custom proxy object for generic previews."""