mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 20:11:20 +00:00
Handle the common chrome browser popup messages.
The Chrome browser presents a number of popups when run for the first time. This update handles those popup messages.
This commit is contained in:
parent
06ba8409c1
commit
9a931f42ee
@ -587,6 +587,27 @@ public class BaseUiAutomation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If Chrome is a fresh install then these popups may be presented
|
||||||
|
// dismiss them if visible.
|
||||||
|
public void dismissChromePopup() throws Exception {
|
||||||
|
UiObject accept =
|
||||||
|
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/terms_accept")
|
||||||
|
.className("android.widget.Button"));
|
||||||
|
if (accept.exists()){
|
||||||
|
accept.click();
|
||||||
|
UiObject negative =
|
||||||
|
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/negative_button")
|
||||||
|
.className("android.widget.Button"));
|
||||||
|
negative.waitForExists(100000);
|
||||||
|
negative.click();
|
||||||
|
}
|
||||||
|
UiObject lite =
|
||||||
|
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/button_secondary")
|
||||||
|
.className("android.widget.Button"));
|
||||||
|
if (lite.exists()){
|
||||||
|
lite.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Override getParams function to decode a url encoded parameter bundle before
|
// Override getParams function to decode a url encoded parameter bundle before
|
||||||
// passing it to workloads.
|
// passing it to workloads.
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -47,7 +47,7 @@ public class UiAutomation extends BaseUiAutomation {
|
|||||||
@Test
|
@Test
|
||||||
public void setup() throws Exception{
|
public void setup() throws Exception{
|
||||||
setScreenOrientation(ScreenOrientation.NATURAL);
|
setScreenOrientation(ScreenOrientation.NATURAL);
|
||||||
clearFirstRun();
|
dismissChromePopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -61,20 +61,6 @@ public class UiAutomation extends BaseUiAutomation {
|
|||||||
unsetScreenOrientation();
|
unsetScreenOrientation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearFirstRun() throws Exception {
|
|
||||||
UiObject accept =
|
|
||||||
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/terms_accept")
|
|
||||||
.className("android.widget.Button"));
|
|
||||||
if (accept.exists()){
|
|
||||||
accept.click();
|
|
||||||
UiObject negative =
|
|
||||||
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/negative_button")
|
|
||||||
.className("android.widget.Button"));
|
|
||||||
negative.waitForExists(100000);
|
|
||||||
negative.click();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void runBenchmark() throws Exception {
|
public void runBenchmark() throws Exception {
|
||||||
UiObject start =
|
UiObject start =
|
||||||
mDevice.findObject(new UiSelector().description("Start Test")
|
mDevice.findObject(new UiSelector().description("Start Test")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user