mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-06 09:05:45 +00:00
Bug 947550 - Wait for Gecko:DelayedStartup in testAboutHomePageNavigation. r=margaret
This commit is contained in:
parent
c3bc072474
commit
11dabed499
@ -27,13 +27,25 @@ public final class GeckoHelper {
|
||||
}
|
||||
|
||||
public static void blockForReady() {
|
||||
final EventExpecter geckoReady = sActions.expectGeckoEvent("Gecko:Ready");
|
||||
blockForEvent("Gecko:Ready");
|
||||
}
|
||||
|
||||
final boolean isReady = GeckoThread.checkLaunchState(LaunchState.GeckoRunning);
|
||||
if (!isReady) {
|
||||
geckoReady.blockForEvent();
|
||||
/**
|
||||
* Blocks for the "Gecko:DelayedStartup" event, which occurs after "Gecko:Ready" and the
|
||||
* first page load.
|
||||
*/
|
||||
public static void blockForDelayedStartup() {
|
||||
blockForEvent("Gecko:DelayedStartup");
|
||||
}
|
||||
|
||||
private static void blockForEvent(final String eventName) {
|
||||
final EventExpecter eventExpecter = sActions.expectGeckoEvent(eventName);
|
||||
|
||||
final boolean isRunning = GeckoThread.checkLaunchState(LaunchState.GeckoRunning);
|
||||
if (!isRunning) {
|
||||
eventExpecter.blockForEvent();
|
||||
}
|
||||
|
||||
geckoReady.unregisterListener();
|
||||
eventExpecter.unregisterListener();
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ public class testAboutHomePageNavigation extends UITest {
|
||||
// enum for both phone and tablet, then swiping through the panels. This will also
|
||||
// benefit having a HomePager with custom panels.
|
||||
public void testAboutHomePageNavigation() {
|
||||
GeckoHelper.blockForReady();
|
||||
GeckoHelper.blockForDelayedStartup();
|
||||
|
||||
mAboutHome.assertVisible()
|
||||
.assertCurrentPanel(PanelType.TOP_SITES);
|
||||
|
Loading…
Reference in New Issue
Block a user