Commit 20e72f4b authored by aluo's avatar aluo Committed by Commit bot

Wait for popup animation using idling resource after select all

BUG=675285

Review-Url: https://codereview.chromium.org/2745893002
Cr-Commit-Position: refs/heads/master@{#456218}
parent b51fdeba
......@@ -94,7 +94,7 @@ public class ActionModeTest {
private static final String MORE_OPTIONS_ACTION = "More options";
private static final String PASTE_ACTION = "Paste";
private static final String SHARE_ACTION = "Share";
private static final String SELECT_ALL_ACTION = "Select All";
private static final String SELECT_ALL_ACTION = "Select all";
private static final String WEB_SEARCH_ACTION = "Web search";
private static final String QUICK_SEARCH_BOX_PKG = "com.google.android.googlequicksearchbox";
......@@ -147,7 +147,7 @@ public class ActionModeTest {
@UseLayout("edittext_webview")
public void testSelectAll() {
longClickOnLastWord(R.id.webview);
clickPopupAction("Select all");
clickPopupAction(SELECT_ALL_ACTION);
clickPopupAction(COPY_ACTION);
longClickOnLastWord(R.id.edittext);
clickPopupAction(PASTE_ACTION);
......@@ -246,6 +246,14 @@ public class ActionModeTest {
.perform(click());
onData(new MenuItemMatcher(equalTo(name))).inRoot(rootMatcher).perform(click());
}
/**
* After select all action is clicked, the PopUp Menu may disappear
* briefly due to selection change, wait for the menu to reappear
*/
if (name.equals(SELECT_ALL_ACTION)) {
mActionBarIdlingResource.start();
}
}
/**
......@@ -286,11 +294,6 @@ public class ActionModeTest {
private boolean mActionStarting;
private ResourceCallback mResourceCallback;
ActionBarIdlingResource() {
mActionStarting = false;
mResourceCallback = null;
}
@Override
public String getName() {
return "ActionBarIdlingResource";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment