зеркало из https://github.com/mozilla/gecko-dev.git
Bug 944144 - Implement NavigationHelper.reload. r=mcomella
This commit is contained in:
Родитель
ec4efe3858
Коммит
6823c231cd
|
@ -29,7 +29,8 @@ import com.jayway.android.robotium.solo.Solo;
|
|||
public class AppMenuComponent extends BaseComponent {
|
||||
public enum MenuItem {
|
||||
FORWARD(R.string.forward),
|
||||
NEW_TAB(R.string.new_tab);
|
||||
NEW_TAB(R.string.new_tab),
|
||||
RELOAD(R.string.reload);
|
||||
|
||||
private final int resourceID;
|
||||
private String stringResource;
|
||||
|
|
|
@ -80,6 +80,10 @@ public class ToolbarComponent extends BaseComponent {
|
|||
return (ImageButton) getToolbarView().findViewById(R.id.forward);
|
||||
}
|
||||
|
||||
private ImageButton getReloadButton() {
|
||||
DeviceHelper.assertIsTablet();
|
||||
return (ImageButton) getToolbarView().findViewById(R.id.reload);
|
||||
}
|
||||
/**
|
||||
* Returns the View for the edit cancel button in the browser toolbar.
|
||||
*/
|
||||
|
@ -190,6 +194,11 @@ public class ToolbarComponent extends BaseComponent {
|
|||
return pressButton(forwardButton, "forward");
|
||||
}
|
||||
|
||||
public ToolbarComponent pressReloadButton() {
|
||||
final ImageButton reloadButton = getReloadButton();
|
||||
return pressButton(reloadButton, "reload");
|
||||
}
|
||||
|
||||
private ToolbarComponent pressButton(final View view, final String buttonName) {
|
||||
fAssertNotNull("The " + buttonName + " button View is not null", view);
|
||||
fAssertTrue("The " + buttonName + " button is enabled", view.isEnabled());
|
||||
|
|
|
@ -88,9 +88,17 @@ final public class NavigationHelper {
|
|||
}
|
||||
|
||||
public static void reload() {
|
||||
// TODO: On tablets, press reload in TOOLBAR. Note that this is technically
|
||||
// an app menu item so tread carefully.
|
||||
// On phones, press reload in APPMENU.
|
||||
throw new UnsupportedOperationException("Not yet implemented.");
|
||||
if (DeviceHelper.isTablet()) {
|
||||
sToolbar.pressReloadButton(); // Waits for page load & asserts isNotEditing.
|
||||
return;
|
||||
}
|
||||
|
||||
sToolbar.assertIsNotEditing();
|
||||
WaitHelper.waitForPageLoad(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
sAppMenu.pressMenuItem(AppMenuComponent.MenuItem.RELOAD);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,10 +28,7 @@ public class testSessionHistory extends UITest {
|
|||
NavigationHelper.goForward();
|
||||
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
|
||||
|
||||
// TODO: Implement this functionality and uncomment.
|
||||
/*
|
||||
NavigationHelper.reload();
|
||||
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче