mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 947550 - Wait for Gecko:DelayedStartup in testAboutHomePageNavigation. r=margaret
This commit is contained in:
parent
8fd3906c59
commit
71dd487cb9
@ -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