mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-03-25 20:18:47 +00:00
Merge pull request #47 from jimboatarm/issue_41
Fixes for googleplaybooks on latest version of apk
This commit is contained in:
commit
4bedf23449
Binary file not shown.
@ -125,10 +125,8 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
new UiObject(new UiSelector().resourceId("com.google.android.apps.books:id/menu_search"));
|
new UiObject(new UiSelector().resourceId("com.google.android.apps.books:id/menu_search"));
|
||||||
search.click();
|
search.click();
|
||||||
|
|
||||||
UiObject searchText =
|
UiObject searchText = new UiObject(new UiSelector().textContains("Search")
|
||||||
getUiObjectByResourceId("com.google.android.apps.books:id/search_src_text",
|
.className("android.widget.EditText"));
|
||||||
"android.widget.EditText");
|
|
||||||
|
|
||||||
searchText.setText(text);
|
searchText.setText(text);
|
||||||
pressEnter();
|
pressEnter();
|
||||||
|
|
||||||
@ -299,7 +297,10 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
UiObject resultList = new UiObject(
|
UiObject resultList = new UiObject(
|
||||||
new UiSelector().resourceId("com.google.android.apps.books:id/search_results_list"));
|
new UiSelector().resourceId("com.google.android.apps.books:id/search_results_list"));
|
||||||
|
|
||||||
if (!resultList.waitForExists(viewTimeout)) {
|
// Allow extra time for search queries involing high freqency words
|
||||||
|
final long searchTimeout = TimeUnit.SECONDS.toMillis(20);
|
||||||
|
|
||||||
|
if (!resultList.waitForExists(searchTimeout)) {
|
||||||
throw new UiObjectNotFoundException("Could not find \"search results list view\".");
|
throw new UiObjectNotFoundException("Could not find \"search results list view\".");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,7 +308,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
new UiObject(new UiSelector().text("Search web")
|
new UiObject(new UiSelector().text("Search web")
|
||||||
.className("android.widget.TextView"));
|
.className("android.widget.TextView"));
|
||||||
|
|
||||||
if (!searchWeb.waitForExists(viewTimeout)) {
|
if (!searchWeb.waitForExists(searchTimeout)) {
|
||||||
throw new UiObjectNotFoundException("Could not find \"Search web view\".");
|
throw new UiObjectNotFoundException("Could not find \"Search web view\".");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,6 +328,14 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
"android.widget.TextView");
|
"android.widget.TextView");
|
||||||
readerSettings.click();
|
readerSettings.click();
|
||||||
|
|
||||||
|
// Check for lighting option button on newer versions
|
||||||
|
UiObject lightingOptionsButton =
|
||||||
|
new UiObject(new UiSelector().resourceId("com.google.android.apps.books:id/lighting_options_button"));
|
||||||
|
|
||||||
|
if (lightingOptionsButton.exists()) {
|
||||||
|
lightingOptionsButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
String[] styles = {"Night", "Sepia", "Day"};
|
String[] styles = {"Night", "Sepia", "Day"};
|
||||||
|
|
||||||
startDumpsysGfxInfo(parameters);
|
startDumpsysGfxInfo(parameters);
|
||||||
@ -334,7 +343,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
for (String style : styles) {
|
for (String style : styles) {
|
||||||
Timer result = new Timer();
|
Timer result = new Timer();
|
||||||
result.start();
|
result.start();
|
||||||
UiObject pageStyle = getUiObjectByDescription(style, "android.widget.TextView");
|
UiObject pageStyle = new UiObject(new UiSelector().description(style));
|
||||||
pageStyle.clickAndWaitForNewWindow(viewTimeout);
|
pageStyle.clickAndWaitForNewWindow(viewTimeout);
|
||||||
result.end();
|
result.end();
|
||||||
timingResults.put(String.format(testTag + "_" + style), result);
|
timingResults.put(String.format(testTag + "_" + style), result);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user