Bug 1415297 - Dispatch TabEvents.LOADED again on DOMContentLoaded. r=sebastian

AddToHomeScreenPromotion uses this for triggering the self-same promotion and
the BrowserToolbar uses it to update its progress display.

MozReview-Commit-ID: 1xrwjWP5Idh

--HG--
extra : rebase_source : 64d9ef66cf8427cccf3f84f59806cada9eddf842
This commit is contained in:
Jan Henning 2017-11-07 22:07:05 +01:00
parent 706ac3aea0
commit 18fe01839f
6 changed files with 12 additions and 7 deletions

View File

@ -152,6 +152,7 @@ public class Tabs implements BundleEventListener {
"Content:SecurityChange",
"Content:StateChange",
"Content:LoadError",
"Content:DOMContentLoaded",
"Content:PageShow",
"Content:DOMTitleChanged",
"DesktopMode:Changed",
@ -637,6 +638,10 @@ public class Tabs implements BundleEventListener {
tab.handleContentLoaded();
notifyListeners(tab, Tabs.TabEvents.LOAD_ERROR);
} else if ("Content:DOMContentLoaded".equals(event)) {
tab.handleContentLoaded();
notifyListeners(tab, TabEvents.LOADED);
} else if ("Content:PageShow".equals(event)) {
tab.setLoadedFromCache(message.getBoolean("fromCache"));
tab.updateUserRequested(message.getString("userRequested"));

View File

@ -85,7 +85,7 @@ abstract class AboutHomeTest extends PixelTest {
View bookmark = getDisplayedBookmark(url);
if (bookmark != null) {
Actions.EventExpecter contentEventExpecter =
mActions.expectGlobalEvent(Actions.EventType.GECKO, "Content:DOMContentLoaded");
mActions.expectGlobalEvent(Actions.EventType.UI, "Content:DOMContentLoaded");
mSolo.clickOnView(bookmark);
contentEventExpecter.blockForEvent();
contentEventExpecter.unregisterListener();

View File

@ -158,7 +158,7 @@ abstract class OldBaseTest extends BaseRobocopTest {
protected final void hitEnterAndWait() {
Actions.EventExpecter contentEventExpecter =
mActions.expectGlobalEvent(Actions.EventType.GECKO, "Content:DOMContentLoaded");
mActions.expectGlobalEvent(Actions.EventType.UI, "Content:DOMContentLoaded");
mActions.sendSpecialKey(Actions.SpecialKey.ENTER);
// wait for screen to load
contentEventExpecter.blockForEvent();
@ -202,7 +202,7 @@ abstract class OldBaseTest extends BaseRobocopTest {
*/
protected final void loadUrlAndWait(final String url) {
Actions.EventExpecter contentEventExpecter =
mActions.expectGlobalEvent(Actions.EventType.GECKO, "Content:DOMContentLoaded");
mActions.expectGlobalEvent(Actions.EventType.UI, "Content:DOMContentLoaded");
loadUrl(url);
contentEventExpecter.blockForEvent();
contentEventExpecter.unregisterListener();

View File

@ -120,7 +120,7 @@ public final class WaitHelper {
// Wait for the page load and title changed event.
final EventExpecter[] eventExpecters = new EventExpecter[] {
sActions.expectGlobalEvent(Actions.EventType.GECKO, "Content:DOMContentLoaded"),
sActions.expectGlobalEvent(Actions.EventType.UI, "Content:DOMContentLoaded"),
sActions.expectGlobalEvent(Actions.EventType.UI, "Content:DOMTitleChanged")
};

View File

@ -30,7 +30,7 @@ public class testAboutPage extends PixelTest {
// Set up listeners to catch the page load we're about to do.
Actions.EventExpecter tabEventExpecter = mActions.expectGlobalEvent(Actions.EventType.UI, "Tab:Added");
Actions.EventExpecter contentEventExpecter = mActions.expectGlobalEvent(Actions.EventType.GECKO, "Content:DOMContentLoaded");
Actions.EventExpecter contentEventExpecter = mActions.expectGlobalEvent(Actions.EventType.UI, "Content:DOMContentLoaded");
selectSettingsItem(mStringHelper.MOZILLA_SECTION_LABEL, mStringHelper.ABOUT_LABEL);

View File

@ -30,7 +30,7 @@ public class testAddonManager extends PixelTest {
// Set up listeners to catch the page load we're about to do
tabEventExpecter = mActions.expectGlobalEvent(Actions.EventType.UI, "Tab:Added");
contentEventExpecter = mActions.expectGlobalEvent(Actions.EventType.GECKO, "Content:DOMContentLoaded");
contentEventExpecter = mActions.expectGlobalEvent(Actions.EventType.UI, "Content:DOMContentLoaded");
// Wait for the new tab and page to load
tabEventExpecter.blockForEvent();
@ -51,7 +51,7 @@ public class testAddonManager extends PixelTest {
// Setup wait for tab to spawn and load
tabEventExpecter = mActions.expectGlobalEvent(Actions.EventType.UI, "Tab:Added");
contentEventExpecter = mActions.expectGlobalEvent(Actions.EventType.GECKO, "Content:DOMContentLoaded");
contentEventExpecter = mActions.expectGlobalEvent(Actions.EventType.UI, "Content:DOMContentLoaded");
// Open a new tab
final String blankURL = getAbsoluteUrl(mStringHelper.ROBOCOP_BLANK_PAGE_01_URL);