зеркало из https://github.com/mozilla/gecko-dev.git
Bug 963561 - Test case for new home banner dismiss handler. r=mcomella
This commit is contained in:
Родитель
61b6952e2c
Коммит
adc15912ee
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче