Bug 1321480: Make Firefox Puppeteer use Marionette's "page load" timeout r=whimboo

This is being used instead of a self-defined Browser.timeout.

MozReview-Commit-ID: 5zAqI38AdHs

--HG--
extra : rebase_source : 1d47dd27db65cde30f5b8b6e7fd38c18fc67243e
This commit is contained in:
Adrianzatreanu adrianzatreanu1@gmail.com 2016-12-01 14:38:11 +02:00
parent 492e3e6a3b
commit 271c772320
8 changed files with 14 additions and 17 deletions

View File

@ -53,7 +53,7 @@ class TestAboutPrivateBrowsing(PuppeteerMixin, MarionetteTestCase):
link.click()
tab = pb_window.tabbar.open_tab(trigger=tab_opener)
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
lambda _: tab.location == self.pb_url)
finally:

View File

@ -45,7 +45,7 @@ class TestMixedScriptContentBlocking(PuppeteerMixin, MarionetteTestCase):
)
# First call to Wait() needs a longer timeout due to the reload of the web page.
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
lambda _: self.locationbar.identity_box.get_attribute('className') == identity,
message='Expected identity "{}" not found'.format(identity)
)

View File

@ -94,7 +94,7 @@ class TestSafeBrowsingNotificationBar(PuppeteerMixin, MarionetteTestCase):
button = self.marionette.find_element(By.ID, 'ignoreWarningButton')
button.click()
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
expected.element_present(By.ID, 'main-feature'),
message='Expected target element "#main-feature" has not been found',
)
@ -113,7 +113,7 @@ class TestSafeBrowsingNotificationBar(PuppeteerMixin, MarionetteTestCase):
self.browser.tabbar.open_tab(lambda _: button.click())
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
lambda mn: report_page in mn.get_url(),
message='The expected safe-browsing report page has not been opened',
)
@ -129,7 +129,7 @@ class TestSafeBrowsingNotificationBar(PuppeteerMixin, MarionetteTestCase):
.find_element('anon attribute', {'label': label}))
button.click()
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
lambda mn: self.browser.default_homepage in mn.get_url(),
message='The default home page has not been loaded',
)
@ -143,7 +143,7 @@ class TestSafeBrowsingNotificationBar(PuppeteerMixin, MarionetteTestCase):
{'class': 'messageCloseButton close-icon tabbable'}))
button.click()
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
expected.element_stale(button),
message='The notification bar has not been closed',
)

View File

@ -69,7 +69,7 @@ class TestSafeBrowsingWarningPages(PuppeteerMixin, MarionetteTestCase):
button = self.marionette.find_element(By.ID, "getMeOutButton")
button.click()
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
lambda mn: self.browser.default_homepage in mn.get_url())
def check_report_button(self, unsafe_page):
@ -86,12 +86,12 @@ class TestSafeBrowsingWarningPages(PuppeteerMixin, MarionetteTestCase):
# Wait for the button to become stale, whereby a longer timeout is needed
# here to not fail in case of slow connections.
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
expected.element_stale(button))
# Wait for page load to be completed, so we can verify the URL even if a redirect happens.
# TODO: Bug 1140470: use replacement for mozmill's waitforPageLoad
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
lambda mn: mn.execute_script('return document.readyState == "DOMContentLoaded" ||'
' document.readyState == "complete";')
)
@ -103,7 +103,7 @@ class TestSafeBrowsingWarningPages(PuppeteerMixin, MarionetteTestCase):
button = self.marionette.find_element(By.ID, 'ignoreWarningButton')
button.click()
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
expected.element_present(By.ID, 'main-feature'))
self.assertEquals(self.marionette.get_url(), self.browser.get_final_url(unsafe_page))

View File

@ -56,5 +56,5 @@ class TestSSLDisabledErrorPage(PuppeteerMixin, MarionetteTestCase):
reset_button.click()
# With the preferences reset, the page has to load correctly
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
expected.element_present(By.LINK_TEXT, 'http://quality.mozilla.org'))

View File

@ -46,7 +46,7 @@ class TestSubmitUnencryptedInfoWarning(PuppeteerMixin, MarionetteTestCase):
try:
Wait(self.marionette,
ignored_exceptions=NoAlertPresentException,
timeout=self.browser.timeout_page_load).until(
timeout=self.marionette.timeout.page_load).until(
lambda _: warning.text == message)
finally:
warning.accept()
@ -55,7 +55,7 @@ class TestSubmitUnencryptedInfoWarning(PuppeteerMixin, MarionetteTestCase):
Wait(self.marionette).until(expected.element_stale(searchbox))
# TODO: Bug 1140470: use replacement for mozmill's waitforPageLoad
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
lambda mn: mn.execute_script('return document.readyState == "DOMContentLoaded" ||'
' document.readyState == "complete";')
)

View File

@ -31,5 +31,5 @@ class TestUntrustedConnectionErrorPage(PuppeteerMixin, MarionetteTestCase):
button = self.marionette.find_element(By.ID, "returnButton")
button.click()
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
lambda mn: target_url == self.marionette.get_url())

View File

@ -45,9 +45,6 @@ class BrowserWindow(BaseWindow):
self._navbar = None
self._tabbar = None
# Timeout for loading remote web pages
self.timeout_page_load = 30
@property
def default_homepage(self):
"""The default homepage as used by the current locale.