mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-03-22 10:38:37 +00:00
Speedometer: Extending teardown function
Some devices throw errors if too many browser tabs are open. Have added a method to close down the tabs in the teardown function.
This commit is contained in:
parent
6d654157b2
commit
ccaca3d6d8
Binary file not shown.
@ -57,6 +57,7 @@ public class UiAutomation extends BaseUiAutomation {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void teardown() throws Exception{
|
public void teardown() throws Exception{
|
||||||
|
clearTabs();
|
||||||
unsetScreenOrientation();
|
unsetScreenOrientation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,5 +95,19 @@ public class UiAutomation extends BaseUiAutomation {
|
|||||||
Log.d(TAG, "Speedometer Score " + textScore);
|
Log.d(TAG, "Speedometer Score " + textScore);
|
||||||
Log.d(TAG, "Speedometer Score " + scores.getContentDescription());
|
Log.d(TAG, "Speedometer Score " + scores.getContentDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearTabs() throws Exception {
|
||||||
|
UiObject tabselector =
|
||||||
|
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/tab_switcher_button")
|
||||||
|
.className("android.widget.ImageButton"));
|
||||||
|
tabselector.click();
|
||||||
|
UiObject menu =
|
||||||
|
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/menu_button")
|
||||||
|
.className("android.widget.ImageButton"));
|
||||||
|
menu.click();
|
||||||
|
UiObject closetabs =
|
||||||
|
mDevice.findObject(new UiSelector().textContains("Close all tabs"));
|
||||||
|
closetabs.click();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user