Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update uiauto library, extend framework to allow jank-testing and add new JetNews jank-testing workload #1268

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
510b344
[framework/uiauto] Update uiauto library to move away from android.su…
luis-machado-arm Jul 3, 2024
18d9f94
[framework/workload] Add support for jank testing
luis-machado-arm Jul 8, 2024
b38e64a
[workloads] Add JetNews jank tests workload
luis-machado-arm Jul 4, 2024
1a308b6
[framework/uiauto] Revert changes to original uiauto library
luis-machado-arm Jul 26, 2024
9212b7f
[workload/JetNews] Address reviewer comments
luis-machado-arm Jul 26, 2024
761cab1
[workload/JetNews] Update timestamp for gradle-wrapper.properties file.
luis-machado-arm Aug 27, 2024
94fa1be
[framework/uiauto-androidx] Update copyright years
luis-machado-arm Aug 27, 2024
aa41d4d
[framework] Undo changes to UiAutomatorGUI
luis-machado-arm Aug 28, 2024
7b53b98
[framework] Create new Jank testing classes
luis-machado-arm Aug 28, 2024
fefaa3c
[workload/jetnews] Use Jank testing classes to implement jank testing…
luis-machado-arm Aug 28, 2024
e046461
[workloads/jetnews] Add missing self reference
luis-machado-arm Aug 29, 2024
77b3dfc
Fix linters/tests CI issues
luis-machado-arm Aug 29, 2024
651fd23
[workloads/jetnews] Disable too-many-ancestors linter for Jetnews class
luis-machado-arm Sep 13, 2024
e85cca9
[workloads/jetnews] Fix more linter issues (E302 and E261)
luis-machado-arm Sep 13, 2024
5180fed
[workloads/jetnews] Harden JetNews testing to cope with tablets/small…
luis-machado-arm Nov 5, 2024
c9ffbfb
[workloads/jetnews] Improve reliability of object detection
luis-machado-arm Nov 13, 2024
0cdccc1
[workloads/jetnews] Restore test default timeout, repeat count and fl…
luis-machado-arm Nov 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion wa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
from wa.framework.target.descriptor import (TargetDescriptor, TargetDescription,
create_target_description, add_description_for_target)
from wa.framework.workload import (Workload, ApkWorkload, ApkUiautoWorkload,
ApkUiautoJankTestWorkload,
ApkReventWorkload, UIWorkload, UiautoWorkload,
PackageHandler, ReventWorkload, TestPackageHandler)
PackageHandler, ReventWorkload, UiAutomatorGUI,
UiAutomatorJankTestGUI, TestPackageHandler)


from wa.framework.version import get_wa_version, get_wa_version_with_commit
Expand Down
18 changes: 18 additions & 0 deletions wa/framework/uiauto-androidx/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apply plugin: 'com.android.library'

android {
namespace "com.arm.wa.uiauto"
compileSdkVersion 28
defaultConfig {
minSdkVersion 18
targetSdkVersion 28
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.test:runner:1.6.1'
implementation 'androidx.test:rules:1.6.1'
implementation 'androidx.test.uiautomator:uiautomator-v18:2.2.0-alpha1'
}
8 changes: 8 additions & 0 deletions wa/framework/uiauto-androidx/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.READ_LOGS"/>

<application>
<uses-library android:name="android.test.runner"/>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* Copyright 2014-2024 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.wa.uiauto;

import android.os.Bundle;
import android.util.Log;
/**
* Basic marker API for workloads to generate start and end markers for
* deliminating and timing actions. Markers are output to logcat with debug
* priority. Actions represent a series of UI interactions to time.
*
* The marker API provides a way for instruments and output processors to hook into
* per-action timings by parsing logcat logs produced per workload iteration.
*
* The marker output consists of a logcat tag 'UX_PERF' and a message. The
* message consists of a name for the action and a timestamp. The timestamp
* is separated by a single space from the name of the action.
*
* Typical usage:
*
* ActionLogger logger = ActionLogger("testTag", parameters);
* logger.start();
* // actions to be recorded
* logger.stop();
*/
public class ActionLogger {

private String testTag;
private boolean enabled;

public ActionLogger(String testTag, Bundle parameters) {
this.testTag = testTag;
this.enabled = parameters.getBoolean("markers_enabled");
}

public void start() {
if (enabled) {
Log.d("UX_PERF", testTag + " start " + System.nanoTime());
}
}

public void stop() throws Exception {
if (enabled) {
Log.d("UX_PERF", testTag + " end " + System.nanoTime());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* Copyright 2013-2024 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.wa.uiauto;

import android.os.Bundle;
import androidx.test.uiautomator.UiObject;

/**
* ApplaunchInterface.java
* Interface used for enabling uxperfapplaunch workload.
* This interface gets implemented by all workloads that support application launch
* instrumentation.
*/

public interface ApplaunchInterface {

/**
* Sets the launchEndObject of a workload, which is a UiObject that marks
* the end of the application launch.
*/
public UiObject getLaunchEndObject();

/**
* Runs the Uiautomation methods for clearing the initial run
* dialogues on the first time installation of an application package.
*/
public void runApplicationSetup() throws Exception;

/**
* Provides the application launch command of the application which is
* constructed as a string from the workload.
*/
public String getLaunchCommand();

/** Passes the workload parameters. */
public void setWorkloadParameters(Bundle parameters);

/** Initialize the instrumentation for the workload */
public void initialize_instrumentation();

}
Loading
Loading