ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #08704
[Merge] lp:~nskaggs/ubuntu-docviewer-app/restore-ap-template into lp:ubuntu-docviewer-app
Nicholas Skaggs has proposed merging lp:~nskaggs/ubuntu-docviewer-app/restore-ap-template into lp:ubuntu-docviewer-app.
Commit message:
Restore AP test shell
Requested reviews:
Ubuntu Document Viewer Developers (ubuntu-docviewer-dev)
For more details, see:
https://code.launchpad.net/~nskaggs/ubuntu-docviewer-app/restore-ap-template/+merge/288454
Restore AP test shell
--
The attached diff has been truncated due to its size.
Your team Ubuntu Document Viewer Developers is requested to review the proposed merge of lp:~nskaggs/ubuntu-docviewer-app/restore-ap-template into lp:ubuntu-docviewer-app.
=== removed directory 'tests-disabled'
=== removed file 'tests-disabled/CMakeLists.txt'
--- tests-disabled/CMakeLists.txt 2014-09-11 20:03:14 +0000
+++ tests-disabled/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-add_subdirectory(autopilot)
=== removed directory 'tests-disabled/autopilot'
=== removed file 'tests-disabled/autopilot/CMakeLists.txt'
--- tests-disabled/autopilot/CMakeLists.txt 2014-09-18 15:00:57 +0000
+++ tests-disabled/autopilot/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
-if(INSTALL_TESTS)
-execute_process(COMMAND python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
- OUTPUT_VARIABLE PYTHON_PACKAGE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-install(DIRECTORY ${AUTOPILOT_DIR}
- DESTINATION ${PYTHON_PACKAGE_DIR}
- )
-endif(INSTALL_TESTS)
-
-add_subdirectory(ubuntu_docviewer_app)
=== removed directory 'tests-disabled/autopilot/ubuntu_docviewer_app'
=== removed file 'tests-disabled/autopilot/ubuntu_docviewer_app/CMakeLists.txt'
--- tests-disabled/autopilot/ubuntu_docviewer_app/CMakeLists.txt 2014-09-17 16:11:30 +0000
+++ tests-disabled/autopilot/ubuntu_docviewer_app/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
-add_subdirectory(tests)
-#add_subdirectory(files)
-
-# make the emulator files visible on qtcreator
-file(GLOB PYTHON_EMULATOR_FILES
- RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
- *.py)
-
-add_custom_target(com_ubuntu_docviewer_PYTHONEMULATORFiles ALL SOURCES ${PYTHON_EMULATOR_FILES})
=== removed file 'tests-disabled/autopilot/ubuntu_docviewer_app/CMakePluginParser.py'
--- tests-disabled/autopilot/ubuntu_docviewer_app/CMakePluginParser.py 2014-10-20 19:04:43 +0000
+++ tests-disabled/autopilot/ubuntu_docviewer_app/CMakePluginParser.py 1970-01-01 00:00:00 +0000
@@ -1,120 +0,0 @@
-# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
-#
-# Copyright (C) 2014 Canonical Ltd.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author:
-# David Planella <david.planella@xxxxxxxxxx>
-
-"""
-This module parses a configuration file from the Qt Creator's CMake plugin and
-enables programmatical read-only access to several of its configuration options
-"""
-
-import sys
-from lxml import etree
-
-
-class CMakePluginParseError(Exception):
- """
- Custom exception for errors during the parsing of a
- CMakeLists.txt.user file
- """
- def __init__(self, message):
- Exception.__init__(self, message)
-
-
-class CMakePluginParser(object):
- """
- Parses a CMake plugin's config file and provides R/O access to its
- configuration options """
-
- def __init__(self, cmakelists_usr_file='CMakeLists.txt.user'):
- self.usr_file = cmakelists_usr_file
-
- try:
- self.info = etree.parse(self.usr_file)
- except:
- sys.stderr.write("Could not open the given " +
- "CMakeLists.txt.user file: " + self.info)
- raise
-
- def _get_active_build_target(self):
- """
- Return the active build target from the current project in Qt Creator
- """
-
- try:
- active_build_target_nr = self.info.xpath(
- "./data/variable" +
- "[text()='ProjectExplorer.Project.ActiveTarget']" +
- "/../value")[0].text
- except:
- raise CMakePluginParseError("Could not find the active build " +
- "target in the CMake plugin's config")
-
- active_build_target = "ProjectExplorer.Project.Target." + \
- active_build_target_nr
-
- return active_build_target
-
- def _get_active_build_config(self, active_build_target):
- """Return the active build config from the active build targed"""
-
- try:
- active_build_config_nr = self.info.xpath(
- "./data/variable[text()='{0}']".format(active_build_target) +
- "/..//value[@key="
- "'ProjectExplorer.Target.ActiveBuildConfiguration']")[0].text
- except:
- raise CMakePluginParseError("Could not find the active build " +
- "target's active build config " +
- "in the CMake plugin's config")
-
- active_build_config = "ProjectExplorer.Target.BuildConfiguration." + \
- active_build_config_nr
-
- return active_build_config
-
- def _get_active_build_config_path(self):
- """Return the active build config's absolute path"""
-
- active_build_target = self._get_active_build_target()
- active_build_config = \
- self._get_active_build_config(active_build_target)
-
- try:
- active_build_config_node = self.info.xpath(
- "./data/variable[text()='{0}']".format(active_build_target) +
- "/..//valuemap[@key='{0}']".format(active_build_config))[0]
- except:
- raise CMakePluginParseError("Could not find the active " +
- "build config's node " +
- "in the CMake plugin's config")
-
- try:
- active_build_config_path = active_build_config_node.xpath(
- "./value[@key=" +
- "'ProjectExplorer.BuildConfiguration.BuildDirectory']")[0].text
- except:
- raise CMakePluginParseError("Could not find the active build " +
- "directory in the CMake plugin's " +
- "config")
-
- return active_build_config_path
-
- @property
- def active_build_dir(self):
- """Return the active build config's directory as an absolute path"""
- return self._get_active_build_config_path()
=== removed file 'tests-disabled/autopilot/ubuntu_docviewer_app/__init__.py'
--- tests-disabled/autopilot/ubuntu_docviewer_app/__init__.py 2015-10-28 15:15:13 +0000
+++ tests-disabled/autopilot/ubuntu_docviewer_app/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,183 +0,0 @@
-# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
-#
-# Copyright (C) 2013, 2014 Canonical Ltd
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 3 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-"""docviewer app autopilot helpers."""
-
-import logging
-from autopilot import logging as autopilot_logging
-logger = logging.getLogger(__name__)
-
-from autopilot.introspection import dbus
-import ubuntuuitoolkit
-
-
-class DocviewerException(ubuntuuitoolkit.ToolkitException):
-
- """Exception raised when there are problems with the docviewer."""
-
-
-class DocviewerApp(object):
-
- """Autopilot helper object for the docviewer application."""
-
- def __init__(self, app_proxy):
- self.app = app_proxy
- self.main_view = self.app.select_single(MainView)
-
- @property
- def pointing_device(self):
- return self.app.pointing_device
-
-
-class MainView(ubuntuuitoolkit.MainView):
-
- """A helper that makes it easy to interact with the docviewer-app."""
-
- def __init__(self, *args):
- super(MainView, self).__init__(*args)
- self.visible.wait_for(True)
-
- def open_PdfView(self):
- """Open the PdfView Page.
-
- :return the PdfView Page
-
- """
- return self.wait_select_single(PdfView)
-
- @autopilot_logging.log_action(logger.info)
- def open_PdfContentsPage(self):
- """Open the PdfContents Page.
-
- :return the PdfContents Page
-
- """
- return self.wait_select_single(PdfContentsPage)
-
- @autopilot_logging.log_action(logger.info)
- def get_PdfViewGotoDialog(self):
- """Return a dialog emulator"""
- return self.wait_select_single(objectName="PdfViewGotoDialog")
-
- @autopilot_logging.log_action(logger.info)
- def go_to_page_from_dialog(self, page_no):
- """ Go to page from get_PfdViewGotoDialog """
- textfield = self.wait_select_single(
- "TextField", objectName="goToPageTextField")
- textfield.write(page_no)
- go_button = self.wait_select_single("Button", objectName="GOButton")
- self.pointing_device.click_object(go_button)
-
- @autopilot_logging.log_action(logger.info)
- def click_go_to_page_button(self):
- """Click the go_to_page header button."""
- header = self.get_header()
- header.click_action_button('gotopage')
-
-
-class Page(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
-
- """Autopilot helper for Pages."""
-
- def __init__(self, *args):
- super(Page, self).__init__(*args)
- # XXX we need a better way to keep reference to the main view.
- # --elopio - 2014-01-31
- self.main_view = self.get_root_instance().select_single(MainView)
-
-
-class PageWithBottomEdge(MainView):
- """
- An emulator class that makes it easy to interact with the bottom edge
- swipe page
- """
- def __init__(self, *args):
- super(PageWithBottomEdge, self).__init__(*args)
-
- def reveal_bottom_edge_page(self):
- """Bring the bottom edge page to the screen"""
- self.bottomEdgePageLoaded.wait_for(True)
- try:
- action_item = self.wait_select_single(objectName='bottomEdgeTip')
- action_item.visible.wait_for(True)
- action_item.stretched.wait_for(True)
- start_x = (action_item.globalRect.x +
- (action_item.globalRect.width * 0.5))
- start_y = (action_item.globalRect.y + 1)
- stop_y = start_y - (self.height * 0.5)
- self.pointing_device.drag(start_x, start_y,
- start_x, stop_y, rate=2)
- self.isReady.wait_for(True)
- except dbus.StateNotFoundError:
- logger.error('BottomEdge element not found.')
- raise
-
-
-class PdfView(PageWithBottomEdge):
- """Autopilot helper for PdfView page."""
-
- @autopilot_logging.log_action(logger.info)
- def toggle_header_visibility(self):
- """Show/hide page header by clicking on the center of main view"""
- self.pointing_device.click_object(self)
-
- def get_currentpage_number(self):
- """return the value of the currentPage property"""
- return self.currentPage
-
-
-class PdfContentsPage(Page):
- """Autopilot helper for PdfContents page."""
-
- @autopilot_logging.log_action(logger.info)
- def get_content_and_line_pageindex(self, labelText):
- content_line, page_no = self._get_listitem(labelText)
- return content_line, page_no
-
- def _get_listitem(self, labelText):
- view_item = self.select_single(
- "QQuickListView", objectName="view")
- list_items_count = view_item.count
-
- index = 0
- for index in range(list_items_count):
- list_item = self.select_single(
- "ListItemWithActions", objectName="delegate{}".format(index))
- while list_item.y > (view_item.contentY +
- view_item.globalRect.height):
- self.scroll_pdfcontentspage()
- label = list_item.select_single("Label", objectName="content")
- if label.text == labelText:
- page_no = list_item.select_single(
- "Label", objectName="pageindex").text
- return label, page_no
- break
-
- @autopilot_logging.log_action(logger.info)
- def click_content_line(self, content_line):
- self.pointing_device.click_object(content_line)
-
- @autopilot_logging.log_action(logger.info)
- def scroll_pdfcontentspage(self):
- action_item = self.select_single("QQuickListView")
- start_x = (action_item.globalRect.x +
- (action_item.globalRect.width * 0.5))
- start_y = (action_item.globalRect.y +
- (action_item.height * 0.8))
- stop_y = start_y - (action_item.height * 0.7)
- self.pointing_device.drag(start_x, start_y,
- start_x, stop_y, rate=2)
- action_item.moving.wait_for(False)
=== removed directory 'tests-disabled/autopilot/ubuntu_docviewer_app/files'
=== removed file 'tests-disabled/autopilot/ubuntu_docviewer_app/files/FCM-91.pdf'
--- tests-disabled/autopilot/ubuntu_docviewer_app/files/FCM-91.pdf 2014-12-14 20:50:23 +0000
+++ tests-disabled/autopilot/ubuntu_docviewer_app/files/FCM-91.pdf 1970-01-01 00:00:00 +0000
@@ -1,3942 +0,0 @@
-%PDF-1.4
-%äüöß
-2 0 obj
-<</Length 3 0 R/Filter/FlateDecode>>
-stream
-x��ˎ%�q���k]�$�/�Q@���0���d�$/����`@��fT�&�������o��7
-/����ۿ���p�|c�����~������Ĕ��[��g��������t�!��N/��
-���XT��͉*Ѣ��Pŋj՝��F/�,*{Q��T��/*YyQŢ��6=P]�%/*[T�u'*la�)�G.�qu�/.l��&���P�:1��|-1�0ʼn�/��pi��ܸ4�+��q}��m���pɍ���qm�/.���� �ݸ:��ϚW��&�8�>s��Z���n^�{Z\r�+N���{q��q4�W'\��N+#��+��q��qq�O�������\����p�u���C�q1�qiW&\uZ1vcuĴyq)N�� Wܸ6�GE�I��o|�T
�WƼ���>�v�JN�#��7�M��`q%�qd���������� Gn\�p�w�F5-�m^\�.�qy�7�M��3�����W'\s�\ڂg顴y���)��Q
-q�7�D)xy�ڄ�Z�(E/W�"M8/[�b�p^�(%K��RJ��T&��5J�[m^Y��9J�'��;J���=J9X\�n�e�R���R��^��3�Y��3{�>�(U�mU3U���٣�{���=J-M8/{�Z�p^�q��n٣Խ�y�٣�����-�q�=���'��=�`�
-^�p�=�`��^�p^�pō��/{DɲG����p^�p^�8��="�e��"�Q�����/{D�M8/{DŲGT���pٍ��/{DղGT��4���g�j^�p^�p^�p^�s��������o�����%��Y�^�m���,w���;ʁ&\v����;�rG9z��ӄ�� W����r���ܚ;��i�J��M��ɢ��*�A���R�PemM�b���-��٢֖�*�!�������(U$�Z��X-jmA�b�������ֶ�*v��I�E���I��դ�͢��(�� �f�4���iHk�I5�qam3
���,nm3
M��T�k�ih�����f�pk�ih� ���T3�K��|cBH�Vs��b�"2�=������fR�,.�m��Inm3
M������T�lW��Lnm3
����`��]�7����f�p^�����-X\[�M2f ��o����,�`�/��wcq���'�Okh6cp�ߍo<c����In��4�^\܌�~7>���64˄[��qi��4�����ڄ[�&���� ������m��7���z�mh� ������Y��Q�����1%����&��h� �����O�h���wcq�����5{�����4�nC����9q�ť ����ZC�D��wcq^����ߍ�/.Z������-b��k^\��Q��g)#��q^ֈ��9b���w���ߍ�/{�7����Z�Y,{�7>{���R&��=J�[\]���=J���'��=b���{cpm}�h�Vݜ}�����(u�����v3:w/{�7���ݜ8�h���/{�7��~7^\�p^�,��ߍ���������/{�7����O��|V�=b��#/{�7�>�-{�7����#�/{�7�����ݜ��q4��=b����F�������\�wcq�CӲG��:�����\�iO�Q�����҄�{cq^�.��ZJ��^��ς��'��Ay�#�/w�7����������U9���E=��PE��5k��2��lU��*&�Z��X,j��2�׳�*F�Z���-j=����?�(6����H���Z��E=ί��W�Q�e�Wa=ǫb7�����z��y���)S��`qa=�M�p�h��v+R�S�Ln=�����4�I�O�|C;蜘Մ�zdJ�<�?�S��hv��)~h�����p�^tN�{H5K�����4��kbH5��P�CC3M��,n�=44������CC3O��ln�=��z�Hk���I�}�=44�N�8���Ln�4˄[o
�,��CC3N���n}�h� �&�T3cuĸ��4�CC�N���!�݊�f2VGL��Y&�{hhv����n�4��:"����f�p����h҄[�
��;����������z��CC�&�{hh��>Ư�z�Hk�������{hh� ������f�pk�������� 祆��yɡ�ф����{^�H�N��$J�L8/M����{Ή��s�Q�m�颤���v*��1J��{Ή��s��k���i��D^�s\��s�Q����������/w$���R'��;Jz�H^�sN��;����r�q�����9�f0�y�t��=uyx�(u/{$:G��=��h�n�4-{D��=����/{D�N8/{Dz�H^�N��=��(Z��k���i�J^�N��=�G^�N��hhZ�����p� �v+��=�����*y��*m���v����=������Y�������5����'��="�?dHk���i��(o�=ʎ+D�&M8/{��:�E�N�(/&����*�����
���Ή���r��\!24ӄ��s�h=K�����Z}�u�)�������~���-�����3o���'���~�G������_~{�֗RB��{>�Ű�����ˏo�ݚ�J���fh�4o�Ջ_ok%V��6J�I)�p5�����������?~��R�v�p�e�HT�8+����v�w�.E���O����s��WQ?n>{ǟ!wn�K�ܹs�i6:b�1���Oc�;�[Gg���Z⦐����6^��o�7B+�� �ƛ����y�4��v�E�_��Z W��ȺJ�
{J��W�N�n8�CD��m*`�ܭC��� �||��?����a ���7y��S6�d�{���]X�:���4�������2�?����?���{S������ݧx�ӯ�u�~=����50�! [nXr�;�J���*���7pPN�#E���FR���9t���Z"pd�����P�����8�S�UB���
>�S�G��;��P����7p��h#x�<ɇ<i��e�O���W��3�UYjj�k����������*�~ຶ:���z�*�)![�F.��ke�n��{���/�W�J߂��"�!�*��&h�\�)M��*la*�����܁��z�7ܔ���>oj���H���&��l��z1���F����\���B�%g����vM�JTSEMO��\�������#֏���m?l>���5wӯ���ĺ+�<Q?
��JAf��|�4�����Xr���zŗ��o&0U���&�3I�p�&i�mY��+}����s��9�~��τ�ɟK2g"�)��{����n��m����*s�&͝I����E�� vԟ[S&�۟K��ʞK����&���e*Iڮ[��v�����������a�^�p%�.sY}�د2 �%a���A%�)C�`i��8=��N`{���'���|���a��F���H�;�rU�2)��k�\uĹ>ʵ �����n��7!J��o&�$̙\V�2�2������>�G����b?�7MW�^�ZS9������m���{o�;��O����O�����+^
���o[�iն�������/��р癄�I�N����-��a�K��#(������xgE��R��\��?��������xÐ�CJ��_��c�t�et�J�F������q��T`שooS�f/����g����8-�����KBs&�W{�W�<����o�5^���tM��3��+��#V�{�'�8)oaQ2���^�������H���e]P��]���i��e�k�ے�����ZS�\H��
-�YZ�K�������[mϙ̴?��ɿM�v�������6q&�6^�<g�
-���)�0S ��]���n�S�J�Ta�ZB<Ջ�-�����W�~/�����,�S6����.��(ͼ>)W�9�u�����,z����y�c���ދ�����=����y�zQ�c�Xq��U��ԑ�����#" w^�F�����"��(
-�%�e�� ���SD��X!��;���D��A���8�Tx��H�_�y��㎠w�-rb�����[�*���Y%M�{��8"�p�
-|�S��2�a����Ih���^�?�qq�q��y���-\�w�8��9/�k����݈XixՇx7���Դ
ߌqKa����&0v�#!�?��ؕd?�1���d����/�4�����/�`M�A�8]/@�A2�D��^V���" �,?C�RX\-�