From 5ef7d2dd44a1ce90be95b8453b4601d60f0ae088 Mon Sep 17 00:00:00 2001 From: John Richardson Date: Wed, 7 Sep 2016 16:51:33 +0100 Subject: [PATCH] Remove skypevideo workload The original skypevideo workload has now been replaced with the newer skype workload. --- wlauto/workloads/skypevideo/__init__.py | 130 ------------------ .../com.arm.wlauto.uiauto.skypevideo.jar | Bin 3210 -> 0 bytes wlauto/workloads/skypevideo/uiauto/build.sh | 28 ---- wlauto/workloads/skypevideo/uiauto/build.xml | 92 ------------- .../skypevideo/uiauto/project.properties | 14 -- .../com/arm/wlauto/uiauto/UiAutomation.java | 72 ---------- 6 files changed, 336 deletions(-) delete mode 100644 wlauto/workloads/skypevideo/__init__.py delete mode 100644 wlauto/workloads/skypevideo/com.arm.wlauto.uiauto.skypevideo.jar delete mode 100755 wlauto/workloads/skypevideo/uiauto/build.sh delete mode 100644 wlauto/workloads/skypevideo/uiauto/build.xml delete mode 100644 wlauto/workloads/skypevideo/uiauto/project.properties delete mode 100644 wlauto/workloads/skypevideo/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java diff --git a/wlauto/workloads/skypevideo/__init__.py b/wlauto/workloads/skypevideo/__init__.py deleted file mode 100644 index 58959e1f..00000000 --- a/wlauto/workloads/skypevideo/__init__.py +++ /dev/null @@ -1,130 +0,0 @@ -# Copyright 2014-2015 ARM Limited -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# pylint: disable=E1101,W0201,E0203 - -import time - -from wlauto import UiAutomatorWorkload, Parameter -from wlauto.utils.types import boolean - - -class SkypeVideo(UiAutomatorWorkload): - - name = 'skypevideo' - description = """ - Initiates Skype video call to a specified contact for a pre-determined duration. - (Note: requires Skype to be set up appropriately). - - This workload is intended for monitoring the behaviour of a device while a Skype - video call is in progress (a common use case). It does not produce any score or - metric and the intention is that some addition instrumentation is enabled while - running this workload. - - This workload, obviously, requires a network connection (ideally, wifi). - - This workload accepts the following parameters: - - - **Skype Setup** - - - You should install Skype client from Google Play Store on the device - (this was tested with client version 4.5.0.39600; other recent versions - should also work). - - You must have an account set up and logged into Skype on the device. - - The contact to be called must be added (and has accepted) to the - account. It's possible to have multiple contacts in the list, however - the contact to be called *must* be visible on initial navigation to the - list. - - The contact must be able to received the call. This means that there - must be a Skype client running (somewhere) with the contact logged in - and that client must have been configured to auto-accept calls from the - account on the device (how to set this varies between different versions - of Skype and between platforms -- please search online for specific - instructions). - https://support.skype.com/en/faq/FA3751/can-i-automatically-answer-all-my-calls-with-video-in-skype-for-windows-desktop - - """ - - package = 'com.skype.raider' - - parameters = [ - Parameter('duration', kind=int, default=300, - description='Duration of the video call in seconds.'), - Parameter('contact', mandatory=True, - description=""" - The name of the Skype contact to call. The contact must be already - added (see below). *If use_gui is set*, then this must be the skype - ID of the contact, *otherwise*, this must be the name of the - contact as it appears in Skype client's contacts list. In the latter case - it *must not* contain underscore characters (``_``); it may, however, contain - spaces. There is no default, you **must specify the name of the contact**. - - .. note:: You may alternatively specify the contact name as - ``skype_contact`` setting in your ``config.py``. If this is - specified, the ``contact`` parameter is optional, though - it may still be specified (in which case it will override - ``skype_contact`` setting). - """), - Parameter('use_gui', kind=boolean, default=False, - description=""" - Specifies whether the call should be placed directly through a - Skype URI, or by navigating the GUI. The URI is the recommended way - to place Skype calls on a device, but that does not seem to work - correctly on some devices (the URI seems to just start Skype, but not - place the call), so an alternative exists that will start the Skype app - and will then navigate the UI to place the call (incidentally, this method - does not seem to work on all devices either, as sometimes Skype starts - backgrounded...). Please note that the meaning of ``contact`` prameter - is different depending on whether this is set. Defaults to ``False``. - - .. note:: You may alternatively specify this as ``skype_use_gui`` setting - in your ``config.py``. - """), - - ] - - def __init__(self, device, **kwargs): - super(SkypeVideo, self).__init__(device, **kwargs) - if self.use_gui: - self.uiauto_params['name'] = self.contact.replace(' ', '_') - self.uiauto_params['duration'] = self.duration - self.run_timeout = self.duration + 30 - - def setup(self, context): - if self.use_gui: - super(SkypeVideo, self).setup(context) - self.device.execute('am force-stop {}'.format(self.package)) - self.device.execute('am start -W -a android.intent.action.VIEW -d skype:') - else: - self.device.execute('am force-stop {}'.format(self.package)) - - def run(self, context): - if self.use_gui: - super(SkypeVideo, self).run(context) - else: - command = "am start -W -a android.intent.action.VIEW -d \"skype:{}?call&video=true\"" - self.logger.debug(self.device.execute(command.format(self.contact))) - self.logger.debug('Call started; waiting for {} seconds...'.format(self.duration)) - time.sleep(self.duration) - self.device.execute('am force-stop com.skype.raider') - - def update_result(self, context): - pass - - def teardown(self, context): - if self.use_gui: - super(SkypeVideo, self).teardown(context) - self.device.execute('am force-stop {}'.format(self.package)) diff --git a/wlauto/workloads/skypevideo/com.arm.wlauto.uiauto.skypevideo.jar b/wlauto/workloads/skypevideo/com.arm.wlauto.uiauto.skypevideo.jar deleted file mode 100644 index dff2302a4de0f90109e25e9450db63ece5c2afcf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3210 zcmZ{mc{mjO7RLu=Y3xggk|~6SG9nS#mqCneY-5iZ%NTo-8YwZT7|I@zFxITe8YYaL zA?wIX)-cncNLTN@_r33PpL@^mIp_TGJKuB8?|FWIe9WLs$4&qMtN=h*1WX6;H)8`F z1DNPqYJv?-_2dtG006Upm9hdtk4lZE{EZMt<)|a)Kk~myO*Bmn^>i&P!h>cJ7IJqwm)e=ronUuWQqR15LCG+w=|!R%CgW$fbLDyKv~R(TQ+x<$GxJZon@V zd8eO!xDoALAMs-Dp&z6+_LVt^ZC-Ew`czxBrn_b{BT_4ylV=9daEy(w;GE7Kiwf=8 z2_3}~lCAs{XEwDHXIO6Dmud@b+il}&9id2Uomn>J?Tcb*4Wxhvhm3;&nT(-WK!iX9 z@IdH2^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b z!5x_5!_YRb)e{@;1ztV5GwTkD!NcyM(Wxd25J!>`dhIeYFQH#Z*9Na6N;8B6*$_AT zwjyYT$z7x~BUgtOjH{j^vsWg+{IMI;mm#|Fc2mz-)n~ZRM=3r16~^u4PbZhA(x9hc zU~fewdvB&8u(IU^K~%VauZlBU<8r^@^klA>vwm<^iKKl(eB$Rr`S+LlV`ddsQp+}9 ztiNIKmY@Eb4dJle?EkntArLQ$fqRGJ<0Y4T-LiPV+j}2Am+sC9hM!Aw*_1NbfkWH| zuqD!6v)(T2vdFGk7ALgFdX2T(=?s3)y|u&kySck|!gi4mw@OciH^&j(uaUI7C30(X zf3Qy;$axMg)irSYM&|GhXwlI@Jd+2eQq3m9KZN6LR~!3g2G6Bd;X*Z2twXk((QuT* zw&TDkeX$YI6ltw;Ht0KNnssv=`tdIYGbjTiKhyu`_ahEIGH$?z=I{I$qW_cT|1JIB zJpWtp+w!rpNAWM|-{}57!~fagzX|+L`JWvckK*5W+zfi0`S&H$(WyPk&A)ja@DE5z B?2Z5c diff --git a/wlauto/workloads/skypevideo/uiauto/build.sh b/wlauto/workloads/skypevideo/uiauto/build.sh deleted file mode 100755 index db6f8ff4..00000000 --- a/wlauto/workloads/skypevideo/uiauto/build.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# Copyright 2014-2015 ARM Limited -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - - - -class_dir=bin/classes/com/arm/wlauto/uiauto -base_class=`python -c "import os, wlauto; print os.path.join(os.path.dirname(wlauto.__file__), 'common', 'android', 'BaseUiAutomation.class')"` -mkdir -p $class_dir -cp $base_class $class_dir - -ant build - -if [[ -f bin/com.arm.wlauto.uiauto.skypevideo.jar ]]; then - cp bin/com.arm.wlauto.uiauto.skypevideo.jar .. -fi diff --git a/wlauto/workloads/skypevideo/uiauto/build.xml b/wlauto/workloads/skypevideo/uiauto/build.xml deleted file mode 100644 index c2fdeb90..00000000 --- a/wlauto/workloads/skypevideo/uiauto/build.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/wlauto/workloads/skypevideo/uiauto/project.properties b/wlauto/workloads/skypevideo/uiauto/project.properties deleted file mode 100644 index ce39f2d0..00000000 --- a/wlauto/workloads/skypevideo/uiauto/project.properties +++ /dev/null @@ -1,14 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-18 diff --git a/wlauto/workloads/skypevideo/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/skypevideo/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java deleted file mode 100644 index 0743372e..00000000 --- a/wlauto/workloads/skypevideo/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright 2014-2015 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -package com.arm.wlauto.uiauto.skypevideo; - -import android.app.Activity; -import android.os.Bundle; -import android.util.Log; -import android.view.KeyEvent; - -// Import the uiautomator libraries -import com.android.uiautomator.core.UiObject; -import com.android.uiautomator.core.UiObjectNotFoundException; -import com.android.uiautomator.core.UiScrollable; -import com.android.uiautomator.core.UiSelector; -import com.android.uiautomator.testrunner.UiAutomatorTestCase; - -import com.arm.wlauto.uiauto.BaseUiAutomation; - -public class UiAutomation extends BaseUiAutomation { - - public static String TAG = "skypevideo"; - public static String videoCallButtonResourceId = "com.skype.raider:id/chat_menu_item_call_video"; - public static String noContactMessage = "Could not find contact \"%s\" in the contacts list."; - - public void runUiAutomation() throws Exception { - Bundle parameters = getParams(); - String contactName = parameters.getString("name").replace('_', ' '); - int duration = Integer.parseInt(parameters.getString("duration")); - - selectContact(contactName); - initiateCall(duration); - } - - public void selectContact(String name) throws Exception { - UiSelector selector = new UiSelector(); - UiObject peopleTab = new UiObject(selector.text("People")); - peopleTab.click(); - sleep(1); // tab transition - - // Note: this assumes that the contact is in view and does not attempt to scroll to find it. - // The expectation is that this automation will be used with a dedicated account that was set - // up for the purpose and so would only have the intended target plus one or two other contacts - // at most in the list. If that is not the case, then this needs to be re-written to scroll to - // find the contact if necessary. - UiObject contactCard = new UiObject(selector.text(name)); - if (!contactCard.exists()) { - throw new UiObjectNotFoundException(String.format(noContactMessage, name)); - } - contactCard.clickAndWaitForNewWindow(); - } - - public void initiateCall(int duration) throws Exception { - UiSelector selector = new UiSelector(); - UiObject videoCallButton = new UiObject(selector.resourceId(videoCallButtonResourceId)); - videoCallButton.click(); - sleep(duration); - } -}