click-update-manager-0.1+14.04.20140306/ 0000755 0000152 0177776 00000000000 12306050250 017714 5 ustar pbuser nogroup 0000000 0000000 click-update-manager-0.1+14.04.20140306/tests/ 0000755 0000152 0177776 00000000000 12306050250 021056 5 ustar pbuser nogroup 0000000 0000000 click-update-manager-0.1+14.04.20140306/tests/autopilot/ 0000755 0000152 0177776 00000000000 12306050250 023076 5 ustar pbuser nogroup 0000000 0000000 click-update-manager-0.1+14.04.20140306/tests/autopilot/CMakeLists.txt 0000644 0000152 0177776 00000000455 12306047726 025660 0 ustar pbuser nogroup 0000000 0000000 set(AUTOPILOT_DIR click_update_manager)
execute_process(COMMAND python -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}
)
click-update-manager-0.1+14.04.20140306/tests/autopilot/click_update_manager/ 0000755 0000152 0177776 00000000000 12306050250 027217 5 ustar pbuser nogroup 0000000 0000000 click-update-manager-0.1+14.04.20140306/tests/autopilot/click_update_manager/__init__.py 0000644 0000152 0177776 00000007255 12306047726 031357 0 ustar pbuser nogroup 0000000 0000000 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
"""Ubuntu Touch App autopilot tests."""
import os
import shutil
import subprocess
from autopilot.input import Pointer
from autopilot.matchers import Eventually
from testtools.matchers import Equals
from ubuntuuitoolkit import base, emulators
def _get_module_include_path():
return os.path.join(_get_path_to_source_root(), 'modules')
def _get_path_to_source_root():
return os.path.abspath(
os.path.join(
os.path.dirname(__file__), '..', '..', '..'))
def _get_local_desktop_file_directory():
return os.path.join(os.environ['HOME'], '.local', 'share', 'applications')
class ClickUpdateManagerTestCase(base.UbuntuUIToolkitAppTestCase):
qml_file_name = 'updatemanager.qml'
path_to_installed_app = '/usr/share/click-update-manager/'
desktop_file_name = 'click-update-manager.desktop'
path_to_installed_desktop_file = '/usr/share/applications/'
local_desktop_file_path = None
def setUp(self):
super(ClickUpdateManagerTestCase, self).setUp()
self.pointing_device = Pointer(self.input_device_class.create())
self.app_qml_source_path = os.path.join(
_get_path_to_source_root(), self.qml_file_name)
self.test_qml_file_path = self._get_test_qml_file_path()
self.desktop_file_path = self._get_desktop_file_path()
self.launch_application()
def _get_test_qml_file_path(self):
if self._application_source_exists():
return self.app_qml_source_path
else:
return os.path.join(
self.path_to_installed_app, self.qml_file_name)
def _application_source_exists(self):
return os.path.exists(self.app_qml_source_path)
def _get_desktop_file_path(self):
if self._application_source_exists():
local_desktop_file_dir = _get_local_desktop_file_directory()
if not os.path.exists(local_desktop_file_dir):
os.makedirs(local_desktop_file_dir)
source_desktop_file_path = os.path.join(
_get_path_to_source_root(), self.desktop_file_name)
local_desktop_file_path = os.path.join(
local_desktop_file_dir, self.desktop_file_name)
shutil.copy(source_desktop_file_path, local_desktop_file_path)
# We can't delete the desktop file before we close the application,
# so we save it on an attribute to be deleted on tear down.
self.local_desktop_file_path = local_desktop_file_path
return local_desktop_file_path
else:
return os.path.join(
self.path_to_installed_desktop_file, self.desktop_file_name)
def launch_application(self):
arch = subprocess.check_output(
["dpkg-architecture", "-qDEB_HOST_MULTIARCH"]).strip()
self.app = self.launch_test_application(
os.path.join('/usr/lib', arch, 'qt5/bin/qmlscene'),
'-I' + _get_module_include_path(),
self.test_qml_file_path,
'--desktop_file_hint={0}'.format(self.desktop_file_path),
emulator_base=emulators.UbuntuUIToolkitEmulatorBase,
app_type='qt')
self.assertThat(
self.main_view.visible, Eventually(Equals(True)))
def tearDown(self):
super(ClickUpdateManagerTestCase, self).tearDown()
# We can't delete the desktop file before we close the application,
# so we save it on an attribute to be deleted on tear down.
if self.local_desktop_file_path is not None:
os.remove(self.local_desktop_file_path)
@property
def main_view(self):
return self.app.select_single(emulators.MainView)
click-update-manager-0.1+14.04.20140306/tests/autopilot/click_update_manager/test_main.py 0000644 0000152 0177776 00000002044 12306047726 031572 0 ustar pbuser nogroup 0000000 0000000 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
"""Tests for PageUpdate"""
from autopilot.matchers import Eventually
from testtools.matchers import Equals
import click_update_manager
class PageUpdateTestCase(click_update_manager.ClickUpdateManagerTestCase):
"""Page Update Tests."""
def test_loading_disappear(self):
"""Check the loading indicator disappears"""
loading = self.main_view.select_single(objectName="loadingIndicator")
self.assertThat(loading.visible, Eventually(Equals(False)))
def test_check_again(self):
"""Check the loading indicator disappears"""
loading = self.main_view.select_single(objectName="loadingIndicator")
self.assertThat(loading.visible, Eventually(Equals(False)))
retry_button = self.main_view.select_single(objectName="retryButton")
self.pointing_device.click_object(retry_button)
self.assertThat(loading.visible, Eventually(Equals(True)))
self.assertThat(loading.visible, Eventually(Equals(False)))
click-update-manager-0.1+14.04.20140306/tests/unit/ 0000755 0000152 0177776 00000000000 12306050250 022035 5 ustar pbuser nogroup 0000000 0000000 click-update-manager-0.1+14.04.20140306/tests/unit/tst_pageupdate.qml 0000644 0000152 0177776 00000026514 12306047726 025607 0 ustar pbuser nogroup 0000000 0000000 import QtQuick 2.0
import QtTest 1.0
import Ubuntu.Components 0.1
import "../../Components"
import "unit_test.js" as UT
// See more details @ http://qt-project.org/doc/qt-5.0/qtquick/qml-testcase.html
// Execute tests with:
// qmltestrunner
Item {
// The objects
QtObject {
id: modelItem1
property string packageName: "com.canonical.package1"
property string title: "My App1"
property string localVersion: "1.0"
property string remoteVersion: "1.1"
property bool toUpdate: true
property string iconUrl: ""
property int binaryFilesize: 5000
property bool updateState: false
property bool selected: false
property string dbusPath: ""
property string error: ""
}
QtObject {
id: modelItem2
property string packageName: "com.canonical.package2"
property string title: "My App2"
property string localVersion: "2.0"
property string remoteVersion: "2.1"
property bool toUpdate: true
property string iconUrl: ""
property int binaryFilesize: 5000
property bool updateState: false
property bool selected: false
property string dbusPath: ""
property string error: ""
}
QtObject {
id: modelItem3
property string packageName: "com.canonical.package3"
property string title: "My App3"
property string localVersion: "3.0"
property string remoteVersion: "3.1"
property bool toUpdate: true
property string iconUrl: ""
property int binaryFilesize: 5000
property bool updateState: false
property bool selected: false
property string dbusPath: ""
property string error: ""
}
property var fakeModel: [modelItem1, modelItem2, modelItem3]
PageUpdate {
id: pageUpdate
}
TestCase {
name: "PageUpdate"
function cleanup() {
for(var i=0; i < fakeModel.length; i++) {
fakeModel[i].error = "";
}
}
function test_updatelist_items() {
var updatelist = UT.findChild(pageUpdate, "updateList");
updatelist.model = fakeModel;
compare(updatelist.count, 3, "expected 3 items in the list");
}
function test_model_0_items() {
var updatelist = UT.findChild(pageUpdate, "updateList");
updatelist.model = [];
pageUpdate.updates = 0;
var clickManager = UT.findChild(pageUpdate, "clickManager");
clickManager.updatesNotFound();
var retryButton = UT.findChild(pageUpdate, "retryButton");
var labelMessage = UT.findChild(pageUpdate, "labelMessage");
var installAllButton = UT.findChild(pageUpdate, "installAllButton");
compare(retryButton.visible, true, "Retry button should be visible");
compare(labelMessage.visible, true, "Label Message button should be visible");
compare(installAllButton.visible, false, "Install All button should not be visible");
}
function test_model_1_item() {
var updatelist = UT.findChild(pageUpdate, "updateList");
var clickManager = UT.findChild(pageUpdate, "clickManager");
clickManager.updateAvailableFound();
updatelist.model = [modelItem1];
pageUpdate.updates = 1;
var retryButton = UT.findChild(pageUpdate, "retryButton");
var labelMessage = UT.findChild(pageUpdate, "labelMessage");
var installAllButton = UT.findChild(pageUpdate, "installAllButton");
compare(retryButton.visible, false, "Retry button should not be visible");
compare(labelMessage.visible, false, "Label Message button should not be visible");
compare(installAllButton.visible, false, "Install All button should not be visible");
}
function test_model_n_items() {
var updatelist = UT.findChild(pageUpdate, "updateList");
var clickManager = UT.findChild(pageUpdate, "clickManager");
clickManager.updateAvailableFound();
updatelist.model = fakeModel;
pageUpdate.updates = 3;
var retryButton = UT.findChild(pageUpdate, "retryButton");
var labelMessage = UT.findChild(pageUpdate, "labelMessage");
var installAllButton = UT.findChild(pageUpdate, "installAllButton");
compare(retryButton.visible, false, "Retry button should not be visible");
compare(labelMessage.visible, false, "Label Message button should not be visible");
compare(installAllButton.visible, true, "Install All button should be visible");
}
function test_label_message_updates_not_found() {
var clickManager = UT.findChild(pageUpdate, "clickManager");
clickManager.updatesNotFound();
var labelMessage = UT.findChild(pageUpdate, "labelMessage");
var installAllButton = UT.findChild(pageUpdate, "installAllButton");
var loadingIndicator = UT.findChild(pageUpdate, "loadingIndicator");
compare(labelMessage.visible, true, "labelMessage should be visible if there isn't a model");
compare(installAllButton.visible, false, "installAllButton should not be visible if there isn't a model");
compare(loadingIndicator.visible, false, "loadingIndicator should not be visible if there isn't a model");
compare(labelMessage.text, i18n.tr("No updates found"), "labelMessage text doesn't match");
}
function test_label_message_credentials_not_found() {
var clickManager = UT.findChild(pageUpdate, "clickManager");
clickManager.credentialsNotFound();
var labelMessage = UT.findChild(pageUpdate, "labelMessage");
var installAllButton = UT.findChild(pageUpdate, "installAllButton");
var loadingIndicator = UT.findChild(pageUpdate, "loadingIndicator");
compare(labelMessage.visible, true, "labelMessage should be visible if there isn't a model");
compare(installAllButton.visible, false, "installAllButton should not be visible if there isn't a model");
compare(loadingIndicator.visible, false, "loadingIndicator should not be visible if there isn't a model");
compare(labelMessage.text, i18n.tr("Please log into your Ubuntu One account in System Settings."), "labelMessage text doesn't match");
}
function test_check_children() {
var updatelist = UT.findChild(pageUpdate, "updateList");
updatelist.model = fakeModel;
for(var i=0; i < fakeModel.length; i++) {
updatelist.currentIndex = i;
var obj = UT.findChild(updatelist.currentItem, "textArea");
compare(updatelist.currentItem.enabled, true, "Should be enabled");
var colLeft = UT.findChild(obj, "colLeft");
compare(colLeft.children[0].color, "#ffffff", "Should be an enabled color");
compare(colLeft.children[1].visible, true, "Should be visible");
compare(colLeft.children[1].text, "Version: " + fakeModel[i].remoteVersion, "Remote versions don't match");
var colRight = UT.findChild(obj, "colRight");
var mbvalue = "4.88 KiB";
compare(colRight.children[1].text, mbvalue, "Other Mb size expected");
}
}
function test_check_children_on_update() {
var updatelist = UT.findChild(pageUpdate, "updateList");
updatelist.model = fakeModel;
for(var i=0; i < fakeModel.length; i++) {
fakeModel[i].updateState = true;
updatelist.currentIndex = i;
var obj = UT.findChild(updatelist.currentItem, "textArea");
compare(updatelist.currentItem.enabled, false, "Should not be enabled");
var colLeft = UT.findChild(obj, "colLeft");
compare(colLeft.children[0].color, "#808080", "Should not be an enabled color");
compare(colLeft.children[1].visible, false, "Should not be visible");
}
}
function test_check_children_tracker_error() {
var updatelist = UT.findChild(pageUpdate, "updateList");
updatelist.model = fakeModel;
for(var i=0; i < fakeModel.length; i++) {
fakeModel[i].updateState = true;
updatelist.currentIndex = i;
var textArea = UT.findChild(updatelist.currentItem, "textArea");
var progress = UT.findChild(updatelist.currentItem, "progress");
var tracker = UT.findChild(progress, "tracker");
tracker.error(i18n.tr("network error"));
compare(updatelist.currentItem.enabled, true, "Should be enabled");
var colLeft = UT.findChild(textArea, "colLeft");
compare(colLeft.children[0].color, "#ffffff", "Should be an enabled color");
compare(colLeft.children[1].visible, true, "Should be visible");
compare(colLeft.children[1].text, i18n.tr("network error"), "Error message doesn't match");
}
}
function test_check_children_tracker_finished() {
var updatelist = UT.findChild(pageUpdate, "updateList");
updatelist.model = fakeModel;
for(var i=0; i < fakeModel.length; i++) {
fakeModel[i].updateState = true;
updatelist.currentIndex = i;
var textArea = UT.findChild(updatelist.currentItem, "textArea");
var progress = UT.findChild(updatelist.currentItem, "progress");
var tracker = UT.findChild(progress, "tracker");
tracker.finished("/path");
compare(updatelist.currentItem.enabled, true, "Should be enabled");
var colLeft = UT.findChild(textArea, "colLeft");
compare(colLeft.children[0].color, "#ffffff", "Should be an enabled color");
compare(colLeft.children[1].visible, true, "Should be visible");
compare(colLeft.children[1].text, i18n.tr("Installed"), "Error message doesn't match");
}
}
function test_check_children_app_error() {
var updatelist = UT.findChild(pageUpdate, "updateList");
updatelist.model = fakeModel;
for(var i=0; i < fakeModel.length; i++) {
fakeModel[i].updateState = true;
fakeModel[i].error = "download error";
updatelist.currentIndex = i;
var textArea = UT.findChild(updatelist.currentItem, "textArea");
compare(updatelist.currentItem.enabled, true, "Should be enabled");
compare(fakeModel[i].updateState, false, "UpdateState should be false");
var colLeft = UT.findChild(textArea, "colLeft");
compare(colLeft.children[0].color, "#ffffff", "Should be an enabled color");
compare(colLeft.children[1].visible, true, "Should be visible");
compare(colLeft.children[1].text, "download error", "Error message doesn't match");
var colRight = UT.findChild(textArea, "colRight");
compare(colRight.children[0].text, i18n.tr("Retry"), "Button text should be: Retry");
}
}
}
}
click-update-manager-0.1+14.04.20140306/tests/unit/unit_test.js 0000644 0000152 0177776 00000000707 12306047726 024433 0 ustar pbuser nogroup 0000000 0000000 .pragma library
// Find an object with the given name in the children tree of "obj"
function findChild(obj,objectName) {
var childs = new Array(0);
childs.push(obj)
while (childs.length > 0) {
if (childs[0].objectName == objectName) {
return childs[0]
}
for (var i in childs[0].children) {
childs.push(childs[0].children[i])
}
childs.splice(0, 1);
}
return undefined;
}
click-update-manager-0.1+14.04.20140306/click-update-manager.desktop 0000644 0000152 0177776 00000000346 12306047726 025305 0 ustar pbuser nogroup 0000000 0000000 [Desktop Entry]
Name=Update Manager
Comment=UpdateManager for Click packages
Exec=/usr/bin/qmlscene $@ /usr/share/click-update-manager/updatemanager.qml
Icon=update_manager_icon
Terminal=false
Type=Application
X-Ubuntu-Touch=true
click-update-manager-0.1+14.04.20140306/CMakeLists.txt 0000644 0000152 0177776 00000001616 12306047726 022476 0 ustar pbuser nogroup 0000000 0000000 project(click-update-manager)
cmake_minimum_required(VERSION 2.8)
include(GNUInstallDirs)
set(CLICK_UPDATE_MANAGER_DIR ${CMAKE_INSTALL_DATADIR}/click-update-manager)
file(GLOB QML_JS_FILES *.qml)
install(FILES ${QML_JS_FILES} DESTINATION ${CLICK_UPDATE_MANAGER_DIR})
install(DIRECTORY Components DESTINATION ${CLICK_UPDATE_MANAGER_DIR})
install(DIRECTORY js DESTINATION ${CLICK_UPDATE_MANAGER_DIR})
install(FILES click-update-manager.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(DIRECTORY icons/hicolor DESTINATION DESTINATION
${CMAKE_INSTALL_DATADIR}/icons FILES_MATCHING PATTERN *.png)
install(DIRECTORY icons/ubuntu-mobile DESTINATION DESTINATION
${CMAKE_INSTALL_DATADIR}/icons FILES_MATCHING PATTERN *.png)
add_custom_target(check
COMMAND xvfb-run -s '-screen 0 640x480x24' -a qmltestrunner -input ${CMAKE_CURRENT_SOURCE_DIR}/tests/unit
)
add_subdirectory(tests/autopilot)
click-update-manager-0.1+14.04.20140306/icons/ 0000755 0000152 0177776 00000000000 12306050250 021027 5 ustar pbuser nogroup 0000000 0000000 click-update-manager-0.1+14.04.20140306/icons/ubuntu-mobile/ 0000755 0000152 0177776 00000000000 12306050250 023616 5 ustar pbuser nogroup 0000000 0000000 click-update-manager-0.1+14.04.20140306/icons/ubuntu-mobile/apps/ 0000755 0000152 0177776 00000000000 12306050250 024561 5 ustar pbuser nogroup 0000000 0000000 click-update-manager-0.1+14.04.20140306/icons/ubuntu-mobile/apps/144/ 0000755 0000152 0177776 00000000000 12306050250 025071 5 ustar pbuser nogroup 0000000 0000000 click-update-manager-0.1+14.04.20140306/icons/ubuntu-mobile/apps/144/update_manager_icon.png 0000644 0000152 0177776 00000017135 12306047726 031610 0 ustar pbuser nogroup 0000000 0000000 PNG
IHDR 2> bKGD pHYs UG tIME
0c IDATx}oǙﯺ{^7Q7x1%8㜇!H6އ d_p
y9AYx^%Y^_{I,ʲd)DI~gkĚ4g{F?fwկ]IRf} t8rH=>GȺM BdBD$I!Voa8*IFQ !$I U$`ߞ$I{'IR)IҲ$I !+UIV <og~ hR lgܬu^=`prw$I#r{V(` !mtC}vIDIJ/$e(7_{oW_}_ R 0^9^t9t: LtZ