mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 963561 - Test case for new home banner dismiss handler. r=mcomella
This commit is contained in:
parent
a2b224a6ae
commit
3ed0707047
@ -117,6 +117,14 @@ public class AboutHomeComponent extends BaseComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
public AboutHomeComponent dismissBanner() {
|
||||
assertBannerVisible();
|
||||
|
||||
mTestContext.dumpLog(LOGTAG, "Clicking on HomeBanner close button.");
|
||||
mSolo.clickOnView(getHomeBannerView().findViewById(R.id.close));
|
||||
return this;
|
||||
}
|
||||
|
||||
public AboutHomeComponent swipeToPanelOnRight() {
|
||||
mTestContext.dumpLog(LOGTAG, "Swiping to the panel on the right.");
|
||||
swipeToPanel(Solo.RIGHT);
|
||||
|
@ -25,6 +25,9 @@ function addMessage() {
|
||||
},
|
||||
onshown: function() {
|
||||
sendMessageToJava({ type: "TestHomeBanner:MessageShown" });
|
||||
},
|
||||
ondismiss: function() {
|
||||
sendMessageToJava({ type: "TestHomeBanner:MessageDismissed" });
|
||||
}
|
||||
});
|
||||
sendMessageToJava({ type: "TestHomeBanner:MessageAdded" });
|
||||
|
@ -49,6 +49,19 @@ public class testHomeBanner extends UITest {
|
||||
NavigationHelper.enterAndLoadUrl("about:home");
|
||||
mAboutHome.assertVisible()
|
||||
.assertBannerNotVisible();
|
||||
|
||||
// Add back the banner message to test the dismiss functionality.
|
||||
addBannerMessage();
|
||||
|
||||
NavigationHelper.enterAndLoadUrl("about:home");
|
||||
mAboutHome.assertVisible();
|
||||
|
||||
// Test to make sure the ondismiss handler is called when the close button is clicked.
|
||||
eventExpecter = getActions().expectGeckoEvent("TestHomeBanner:MessageDismissed");
|
||||
mAboutHome.dismissBanner();
|
||||
eventExpecter.blockForEvent();
|
||||
|
||||
mAboutHome.assertBannerNotVisible();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user