mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 14:25:49 +00:00
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:
parent
706ac3aea0
commit
18fe01839f
@ -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"));
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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")
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user