mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 09:15:35 +00:00
Bug 1316851 - Firefox UI tests have to use super() to call base class methods. r=maja_zf
MozReview-Commit-ID: E4FSmQePtqv --HG-- extra : rebase_source : 96ca362ca6d295644005ce8682ccfad459942420
This commit is contained in:
parent
d6fd5ce075
commit
2eb0e84bcb
@ -10,7 +10,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestAccessLocationBar(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestAccessLocationBar, self).setUp()
|
||||
|
||||
# Clear complete history so there's no interference from previous entries.
|
||||
self.puppeteer.places.remove_all_history()
|
||||
|
@ -10,7 +10,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestEscapeAutocomplete(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestEscapeAutocomplete, self).setUp()
|
||||
|
||||
# Clear complete history so there's no interference from previous entries.
|
||||
self.puppeteer.places.remove_all_history()
|
||||
@ -29,7 +29,8 @@ class TestEscapeAutocomplete(FirefoxTestCase):
|
||||
|
||||
def tearDown(self):
|
||||
self.autocomplete_results.close(force=True)
|
||||
FirefoxTestCase.tearDown(self)
|
||||
|
||||
super(TestEscapeAutocomplete, self).tearDown()
|
||||
|
||||
def test_escape_autocomplete(self):
|
||||
# Open some local pages
|
||||
|
@ -13,7 +13,7 @@ class TestFaviconInAutocomplete(FirefoxTestCase):
|
||||
PREF_SUGGEST_BOOKMARK = 'browser.urlbar.suggest.bookmark'
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestFaviconInAutocomplete, self).setUp()
|
||||
|
||||
# Disable suggestions for searches and bookmarks to get results only for history
|
||||
self.puppeteer.prefs.set_pref(self.PREF_SUGGEST_SEARCHES, False)
|
||||
@ -34,7 +34,7 @@ class TestFaviconInAutocomplete(FirefoxTestCase):
|
||||
self.marionette.clear_pref(self.PREF_SUGGEST_SEARCHES)
|
||||
self.marionette.clear_pref(self.PREF_SUGGEST_BOOKMARK)
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestFaviconInAutocomplete, self).tearDown()
|
||||
|
||||
def test_favicon_in_autocomplete(self):
|
||||
# Open the test page
|
||||
|
@ -16,7 +16,7 @@ class TestStarInAutocomplete(FirefoxTestCase):
|
||||
PREF_SUGGEST_SEARCHES = 'browser.urlbar.suggest.searches'
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestStarInAutocomplete, self).setUp()
|
||||
|
||||
self.bookmark_panel = None
|
||||
self.test_urls = [self.marionette.absolute_url('layout/mozilla_grants.html')]
|
||||
@ -41,7 +41,7 @@ class TestStarInAutocomplete(FirefoxTestCase):
|
||||
self.puppeteer.places.restore_default_bookmarks()
|
||||
self.marionette.clear_pref(self.PREF_SUGGEST_SEARCHES)
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestStarInAutocomplete, self).tearDown()
|
||||
|
||||
def test_star_in_autocomplete(self):
|
||||
search_string = 'grants'
|
||||
|
@ -12,7 +12,7 @@ from firefox_puppeteer.ui.browser.window import BrowserWindow
|
||||
class TestAboutPrivateBrowsing(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestAboutPrivateBrowsing, self).setUp()
|
||||
|
||||
# Use a fake local support URL
|
||||
support_url = 'about:blank?'
|
||||
@ -24,7 +24,7 @@ class TestAboutPrivateBrowsing(FirefoxTestCase):
|
||||
try:
|
||||
self.marionette.clear_pref('app.support.baseURL')
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestAboutPrivateBrowsing, self).tearDown()
|
||||
|
||||
def testCheckAboutPrivateBrowsing(self):
|
||||
self.assertFalse(self.browser.is_private)
|
||||
|
@ -10,7 +10,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestDVCertificate(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestDVCertificate, self).setUp()
|
||||
|
||||
self.locationbar = self.browser.navbar.locationbar
|
||||
self.identity_popup = self.browser.navbar.locationbar.identity_popup
|
||||
@ -23,7 +23,7 @@ class TestDVCertificate(FirefoxTestCase):
|
||||
self.identity_popup.close(force=True)
|
||||
self.puppeteer.windows.close_all([self.browser])
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestDVCertificate, self).tearDown()
|
||||
|
||||
def test_dv_cert(self):
|
||||
with self.marionette.using_context('content'):
|
||||
|
@ -9,14 +9,10 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
|
||||
class TestEnablePrivilege(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
|
||||
self.url = self.marionette.absolute_url('security/enable_privilege.html')
|
||||
|
||||
def test_enable_privilege(self):
|
||||
with self.marionette.using_context('content'):
|
||||
self.marionette.navigate(self.url)
|
||||
url = self.marionette.absolute_url('security/enable_privilege.html')
|
||||
self.marionette.navigate(url)
|
||||
|
||||
result = self.marionette.find_element(By.ID, 'result')
|
||||
self.assertEqual(result.get_property('textContent'), 'PASS')
|
||||
|
@ -10,7 +10,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestEVCertificate(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestEVCertificate, self).setUp()
|
||||
|
||||
self.locationbar = self.browser.navbar.locationbar
|
||||
self.identity_popup = self.locationbar.identity_popup
|
||||
@ -23,7 +23,7 @@ class TestEVCertificate(FirefoxTestCase):
|
||||
self.identity_popup.close(force=True)
|
||||
self.puppeteer.windows.close_all([self.browser])
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestEVCertificate, self).tearDown()
|
||||
|
||||
def test_ev_certificate(self):
|
||||
with self.marionette.using_context('content'):
|
||||
|
@ -7,7 +7,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
|
||||
class TestMixedContentPage(FirefoxTestCase):
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestMixedContentPage, self).setUp()
|
||||
|
||||
self.locationbar = self.browser.navbar.locationbar
|
||||
self.identity_popup = self.locationbar.identity_popup
|
||||
@ -18,7 +18,7 @@ class TestMixedContentPage(FirefoxTestCase):
|
||||
try:
|
||||
self.identity_popup.close(force=True)
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestMixedContentPage, self).tearDown()
|
||||
|
||||
def test_mixed_content(self):
|
||||
with self.marionette.using_context('content'):
|
||||
|
@ -10,7 +10,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestMixedScriptContentBlocking(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestMixedScriptContentBlocking, self).setUp()
|
||||
|
||||
self.url = 'https://mozqa.com/data/firefox/security/mixed_content_blocked/index.html'
|
||||
|
||||
@ -28,7 +28,7 @@ class TestMixedScriptContentBlocking(FirefoxTestCase):
|
||||
try:
|
||||
self.identity_popup.close(force=True)
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestMixedScriptContentBlocking, self).tearDown()
|
||||
|
||||
def _expect_protection_status(self, enabled):
|
||||
if enabled:
|
||||
|
@ -12,7 +12,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestNoCertificate(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestNoCertificate, self).setUp()
|
||||
|
||||
self.locationbar = self.browser.navbar.locationbar
|
||||
self.identity_popup = self.locationbar.identity_popup
|
||||
@ -25,7 +25,7 @@ class TestNoCertificate(FirefoxTestCase):
|
||||
self.identity_popup.close(force=True)
|
||||
self.puppeteer.windows.close_all([self.browser])
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestNoCertificate, self).tearDown()
|
||||
|
||||
def test_no_certificate(self):
|
||||
with self.marionette.using_context('content'):
|
||||
|
@ -51,7 +51,7 @@ class TestSafeBrowsingInitialDownload(FirefoxTestCase):
|
||||
return set(sorted(files))
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestSafeBrowsingInitialDownload, self).setUp()
|
||||
|
||||
# Force the preferences for the new profile
|
||||
enforce_prefs = self.prefs_safebrowsing
|
||||
@ -67,7 +67,7 @@ class TestSafeBrowsingInitialDownload(FirefoxTestCase):
|
||||
# Restart with a fresh profile
|
||||
self.restart(clean=True)
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestSafeBrowsingInitialDownload, self).tearDown()
|
||||
|
||||
def test_safe_browsing_initial_download(self):
|
||||
def check_downloaded(_):
|
||||
|
@ -12,7 +12,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestSafeBrowsingNotificationBar(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestSafeBrowsingNotificationBar, self).setUp()
|
||||
|
||||
self.test_data = [
|
||||
# Unwanted software URL
|
||||
@ -56,7 +56,7 @@ class TestSafeBrowsingNotificationBar(FirefoxTestCase):
|
||||
self.marionette.clear_pref('browser.safebrowsing.phishing.enabled')
|
||||
self.marionette.clear_pref('browser.safebrowsing.malware.enabled')
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestSafeBrowsingNotificationBar, self).tearDown()
|
||||
|
||||
def test_notification_bar(self):
|
||||
with self.marionette.using_context('content'):
|
||||
|
@ -12,7 +12,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestSafeBrowsingWarningPages(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestSafeBrowsingWarningPages, self).setUp()
|
||||
|
||||
self.urls = [
|
||||
# Unwanted software URL
|
||||
@ -42,7 +42,7 @@ class TestSafeBrowsingWarningPages(FirefoxTestCase):
|
||||
self.marionette.clear_pref('browser.safebrowsing.malware.enabled')
|
||||
self.marionette.clear_pref('browser.safebrowsing.phishing.enabled')
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestSafeBrowsingWarningPages, self).tearDown()
|
||||
|
||||
def test_warning_pages(self):
|
||||
with self.marionette.using_context("content"):
|
||||
|
@ -13,7 +13,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestSecurityNotification(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestSecurityNotification, self).setUp()
|
||||
|
||||
self.urls = [
|
||||
# Invalid cert page
|
||||
|
@ -13,7 +13,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestSSLDisabledErrorPage(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestSSLDisabledErrorPage, self).setUp()
|
||||
|
||||
self.url = 'https://tlsv1-0.mozqa.com'
|
||||
|
||||
@ -30,7 +30,7 @@ class TestSSLDisabledErrorPage(FirefoxTestCase):
|
||||
self.marionette.clear_pref('security.tls.version.min')
|
||||
self.marionette.clear_pref('security.tls.version.max')
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestSSLDisabledErrorPage, self).tearDown()
|
||||
|
||||
def test_ssl_disabled_error_page(self):
|
||||
with self.marionette.using_context('content'):
|
||||
|
@ -11,7 +11,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestSSLStatusAfterRestart(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestSSLStatusAfterRestart, self).setUp()
|
||||
|
||||
self.test_data = (
|
||||
{
|
||||
@ -45,7 +45,7 @@ class TestSSLStatusAfterRestart(FirefoxTestCase):
|
||||
self.identity_popup.close(force=True)
|
||||
self.marionette.clear_pref('browser.startup.page')
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestSSLStatusAfterRestart, self).tearDown()
|
||||
|
||||
@skip_if_e10s
|
||||
def test_ssl_status_after_restart(self):
|
||||
|
@ -13,7 +13,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestSubmitUnencryptedInfoWarning(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestSubmitUnencryptedInfoWarning, self).setUp()
|
||||
|
||||
self.url = 'https://ssl-dv.mozqa.com/data/firefox/security/unencryptedsearch.html'
|
||||
self.test_string = 'mozilla'
|
||||
@ -24,7 +24,7 @@ class TestSubmitUnencryptedInfoWarning(FirefoxTestCase):
|
||||
try:
|
||||
self.marionette.clear_pref('security.warn_submit_insecure')
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestSubmitUnencryptedInfoWarning, self).tearDown()
|
||||
|
||||
def test_submit_unencrypted_info_warning(self):
|
||||
with self.marionette.using_context('content'):
|
||||
|
@ -13,7 +13,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestUnknownIssuer(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestUnknownIssuer, self).setUp()
|
||||
|
||||
self.url = 'https://ssl-unknownissuer.mozqa.com'
|
||||
|
||||
|
@ -11,8 +11,9 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
|
||||
|
||||
class TestUntrustedConnectionErrorPage(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestUntrustedConnectionErrorPage, self).setUp()
|
||||
|
||||
self.url = 'https://ssl-selfsigned.mozqa.com'
|
||||
|
||||
|
@ -8,7 +8,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestRestoreWindowsAfterRestart(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestRestoreWindowsAfterRestart, self).setUp()
|
||||
|
||||
# Each list element represents a window of tabs loaded at
|
||||
# some testing URL
|
||||
@ -51,7 +51,7 @@ class TestRestoreWindowsAfterRestart(FirefoxTestCase):
|
||||
# Create a fresh profile for subsequent tests.
|
||||
self.restart(clean=True)
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestRestoreWindowsAfterRestart, self).tearDown()
|
||||
|
||||
def test_with_variety(self):
|
||||
""" Opens a set of windows, both standard and private, with
|
||||
|
@ -8,7 +8,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestAboutWindow(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestAboutWindow, self).setUp()
|
||||
|
||||
self.about_window = self.browser.open_about_window()
|
||||
self.deck = self.about_window.deck
|
||||
@ -17,7 +17,7 @@ class TestAboutWindow(FirefoxTestCase):
|
||||
try:
|
||||
self.puppeteer.windows.close_all([self.browser])
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestAboutWindow, self).tearDown()
|
||||
|
||||
def test_basic(self):
|
||||
self.assertEqual(self.about_window.window_type, 'Browser:About')
|
||||
|
@ -12,11 +12,9 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestL10n(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
self.l10n = L10n(self.marionette)
|
||||
super(TestL10n, self).setUp()
|
||||
|
||||
def tearDown(self):
|
||||
FirefoxTestCase.tearDown(self)
|
||||
self.l10n = L10n(self.marionette)
|
||||
|
||||
def test_dtd_entity_chrome(self):
|
||||
dtds = ['chrome://global/locale/about.dtd',
|
||||
|
@ -10,7 +10,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestMenuBar(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestMenuBar, self).setUp()
|
||||
|
||||
def test_click_item_in_menubar(self):
|
||||
def opener(_):
|
||||
|
@ -15,7 +15,7 @@ from firefox_puppeteer.ui.browser.notifications import (
|
||||
class TestNotifications(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestNotifications, self).setUp()
|
||||
|
||||
self.puppeteer.prefs.set_pref('extensions.install.requireSecureOrigin', False)
|
||||
|
||||
@ -32,7 +32,7 @@ class TestNotifications(FirefoxTestCase):
|
||||
if self.browser.notification:
|
||||
self.browser.notification.close(force=True)
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestNotifications, self).tearDown()
|
||||
|
||||
def test_open_close_notification(self):
|
||||
"""Trigger and dismiss a notification"""
|
||||
|
@ -11,7 +11,7 @@ class TestPageInfoWindow(FirefoxTestCase):
|
||||
try:
|
||||
self.puppeteer.windows.close_all([self.browser])
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestPageInfoWindow, self).tearDown()
|
||||
|
||||
def test_elements(self):
|
||||
"""Test correct retrieval of elements."""
|
||||
|
@ -10,7 +10,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestPlaces(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestPlaces, self).setUp()
|
||||
|
||||
self.urls = [self.marionette.absolute_url('layout/mozilla_governance.html'),
|
||||
self.marionette.absolute_url('layout/mozilla_grants.html'),
|
||||
@ -21,7 +21,7 @@ class TestPlaces(FirefoxTestCase):
|
||||
self.puppeteer.places.restore_default_bookmarks()
|
||||
self.puppeteer.places.remove_all_history()
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestPlaces, self).tearDown()
|
||||
|
||||
def get_all_urls_in_history(self):
|
||||
return self.marionette.execute_script("""
|
||||
|
@ -8,7 +8,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class testPreferences(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(testPreferences, self).setUp()
|
||||
|
||||
self.new_pref = 'marionette.unittest.set_pref'
|
||||
self.unknown_pref = 'marionette.unittest.unknown'
|
||||
@ -27,7 +27,7 @@ class testPreferences(FirefoxTestCase):
|
||||
self.marionette.clear_pref('browser.tabs.maxOpenBeforeWarn')
|
||||
self.marionette.clear_pref('browser.startup.homepage')
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(testPreferences, self).tearDown()
|
||||
|
||||
def test_get_pref(self):
|
||||
# check correct types
|
||||
|
@ -12,7 +12,8 @@ from firefox_puppeteer.api.software_update import SoftwareUpdate
|
||||
class TestSoftwareUpdate(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestSoftwareUpdate, self).setUp()
|
||||
|
||||
self.software_update = SoftwareUpdate(self.marionette)
|
||||
|
||||
self.saved_mar_channels = self.software_update.mar_channels.channels
|
||||
@ -22,7 +23,7 @@ class TestSoftwareUpdate(FirefoxTestCase):
|
||||
try:
|
||||
self.software_update.mar_channels.channels = self.saved_mar_channels
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestSoftwareUpdate, self).tearDown()
|
||||
|
||||
def test_abi(self):
|
||||
self.assertTrue(self.software_update.ABI)
|
||||
@ -71,7 +72,8 @@ class TestSoftwareUpdate(FirefoxTestCase):
|
||||
class TestUpdateChannel(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestUpdateChannel, self).setUp()
|
||||
|
||||
self.software_update = SoftwareUpdate(self.marionette)
|
||||
|
||||
self.saved_channel = self.software_update.update_channel.default_channel
|
||||
@ -81,7 +83,7 @@ class TestUpdateChannel(FirefoxTestCase):
|
||||
try:
|
||||
self.software_update.update_channel.default_channel = self.saved_channel
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestUpdateChannel, self).tearDown()
|
||||
|
||||
def test_update_channel_channel(self):
|
||||
self.assertEqual(self.software_update.update_channel.channel, self.saved_channel)
|
||||
@ -97,7 +99,8 @@ class TestUpdateChannel(FirefoxTestCase):
|
||||
class TestMARChannels(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestMARChannels, self).setUp()
|
||||
|
||||
self.software_update = SoftwareUpdate(self.marionette)
|
||||
|
||||
self.saved_mar_channels = self.software_update.mar_channels.channels
|
||||
@ -107,7 +110,7 @@ class TestMARChannels(FirefoxTestCase):
|
||||
try:
|
||||
self.software_update.mar_channels.channels = self.saved_mar_channels
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestMARChannels, self).tearDown()
|
||||
|
||||
def test_mar_channels_channels(self):
|
||||
self.assertEqual(self.software_update.mar_channels.channels, set(['expected', 'channels']))
|
||||
|
@ -13,7 +13,7 @@ class TestTabBar(FirefoxTestCase):
|
||||
try:
|
||||
self.browser.tabbar.close_all_tabs([self.browser.tabbar.tabs[0]])
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestTabBar, self).tearDown()
|
||||
|
||||
def test_basics(self):
|
||||
tabbar = self.browser.tabbar
|
||||
@ -120,7 +120,7 @@ class TestTab(FirefoxTestCase):
|
||||
try:
|
||||
self.browser.tabbar.close_all_tabs([self.browser.tabbar.tabs[0]])
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestTab, self).tearDown()
|
||||
|
||||
def test_basic(self):
|
||||
tab = self.browser.tabbar.tabs[0]
|
||||
|
@ -11,7 +11,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestNavBar(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestNavBar, self).setUp()
|
||||
|
||||
self.navbar = self.browser.navbar
|
||||
self.url = self.marionette.absolute_url('layout/mozilla.html')
|
||||
@ -80,7 +80,7 @@ class TestNavBar(FirefoxTestCase):
|
||||
class TestLocationBar(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestLocationBar, self).setUp()
|
||||
|
||||
self.locationbar = self.browser.navbar.locationbar
|
||||
|
||||
@ -136,7 +136,8 @@ class TestLocationBar(FirefoxTestCase):
|
||||
class TestAutoCompleteResults(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestAutoCompleteResults, self).setUp()
|
||||
|
||||
self.browser.navbar.locationbar.clear()
|
||||
|
||||
self.autocomplete_results = self.browser.navbar.locationbar.autocomplete_results
|
||||
@ -149,7 +150,7 @@ class TestAutoCompleteResults(FirefoxTestCase):
|
||||
# autocomplete_results element are skipped.
|
||||
pass
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestAutoCompleteResults, self).tearDown()
|
||||
|
||||
def test_popup_elements(self):
|
||||
# TODO: This test is not very robust because it relies on the history
|
||||
@ -204,7 +205,7 @@ class TestAutoCompleteResults(FirefoxTestCase):
|
||||
|
||||
class TestIdentityPopup(FirefoxTestCase):
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestIdentityPopup, self).setUp()
|
||||
|
||||
self.locationbar = self.browser.navbar.locationbar
|
||||
self.identity_popup = self.locationbar.identity_popup
|
||||
@ -218,7 +219,7 @@ class TestIdentityPopup(FirefoxTestCase):
|
||||
try:
|
||||
self.identity_popup.close(force=True)
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestIdentityPopup, self).tearDown()
|
||||
|
||||
def test_elements(self):
|
||||
self.locationbar.open_identity_popup()
|
||||
|
@ -9,7 +9,7 @@ from firefox_puppeteer.ui.update_wizard import UpdateWizardDialog
|
||||
class TestUpdateWizard(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestUpdateWizard, self).setUp()
|
||||
|
||||
def opener(win):
|
||||
self.marionette.execute_script("""
|
||||
@ -26,7 +26,7 @@ class TestUpdateWizard(FirefoxTestCase):
|
||||
try:
|
||||
self.puppeteer.windows.close_all([self.browser])
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(TestUpdateWizard, self).tearDown()
|
||||
|
||||
def test_basic(self):
|
||||
self.assertEqual(self.dialog.window_type, 'Update:Wizard')
|
||||
|
@ -8,7 +8,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
class TestSanitize(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(TestSanitize, self).setUp()
|
||||
|
||||
# Clear all previous history and cookies.
|
||||
self.puppeteer.places.remove_all_history()
|
||||
@ -29,9 +29,6 @@ class TestSanitize(FirefoxTestCase):
|
||||
self.marionette.navigate(url)
|
||||
self.puppeteer.places.wait_for_visited(self.urls, load_urls)
|
||||
|
||||
def tearDown(self):
|
||||
FirefoxTestCase.tearDown(self)
|
||||
|
||||
def test_sanitize_history(self):
|
||||
""" Clears history. """
|
||||
self.assertEqual(self.puppeteer.places.get_all_urls_in_history(), self.urls)
|
||||
|
@ -12,6 +12,7 @@ from firefox_ui_harness.testcases import FirefoxTestCase
|
||||
|
||||
|
||||
class BaseWindowTestCase(FirefoxTestCase):
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
These tests open and close windows pretty rapidly, which
|
||||
@ -26,14 +27,15 @@ class BaseWindowTestCase(FirefoxTestCase):
|
||||
setting dom.ipc.tabs.shutdownTimeoutSecs to 0, which disables
|
||||
the shutdown timer.
|
||||
"""
|
||||
FirefoxTestCase.setUp(self)
|
||||
super(BaseWindowTestCase, self).setUp()
|
||||
|
||||
self.puppeteer.prefs.set_pref('dom.ipc.tabs.shutdownTimeoutSecs', 0)
|
||||
|
||||
def tearDown(self):
|
||||
try:
|
||||
self.marionette.clear_pref('dom.ipc.tabs.shutdownTimeoutSecs')
|
||||
finally:
|
||||
FirefoxTestCase.tearDown(self)
|
||||
super(BaseWindowTestCase, self).tearDown()
|
||||
|
||||
|
||||
class TestWindows(BaseWindowTestCase):
|
||||
@ -42,7 +44,7 @@ class TestWindows(BaseWindowTestCase):
|
||||
try:
|
||||
self.puppeteer.windows.close_all([self.browser])
|
||||
finally:
|
||||
BaseWindowTestCase.tearDown(self)
|
||||
super(TestWindows, self).tearDown()
|
||||
|
||||
def test_switch_to(self):
|
||||
url = self.marionette.absolute_url('layout/mozilla.html')
|
||||
|
Loading…
Reference in New Issue
Block a user