Backed out changeset a892984bb20c (bug 1322383)

This commit is contained in:
Sebastian Hengst 2017-03-21 19:05:48 +01:00
parent cdf08f2266
commit 776d54c879
3 changed files with 7 additions and 14 deletions

View File

@ -21,9 +21,6 @@ class TestAboutPrivateBrowsing(PuppeteerMixin, MarionetteTestCase):
def tearDown(self):
try:
self.puppeteer.windows.close_all([self.browser])
self.browser.switch_to()
self.marionette.clear_pref('app.support.baseURL')
finally:
super(TestAboutPrivateBrowsing, self).tearDown()

View File

@ -43,7 +43,6 @@ class TestWindows(BaseWindowTestCase):
def tearDown(self):
try:
self.puppeteer.windows.close_all([self.browser])
self.browser.switch_to()
finally:
super(TestWindows, self).tearDown()
@ -108,9 +107,8 @@ class TestBaseWindow(BaseWindowTestCase):
def tearDown(self):
try:
self.puppeteer.windows.close_all([self.browser])
self.browser.switch_to()
finally:
super(TestBaseWindow, self).tearDown()
BaseWindowTestCase.tearDown(self)
def test_basics(self):
# force BaseWindow instance
@ -149,8 +147,7 @@ class TestBaseWindow(BaseWindowTestCase):
self.assertTrue(win2.closed)
self.assertEquals(len(self.marionette.chrome_window_handles), 1)
with self.assertRaises(NoSuchWindowException):
self.marionette.current_chrome_window_handle
self.assertEquals(win2.handle, self.marionette.current_chrome_window_handle)
Wait(self.marionette).until(lambda _: win1.focused) # catch the no focused window
win1.focus()
@ -218,9 +215,8 @@ class TestBrowserWindow(BaseWindowTestCase):
def tearDown(self):
try:
self.puppeteer.windows.close_all([self.browser])
self.browser.switch_to()
finally:
super(TestBrowserWindow, self).tearDown()
BaseWindowTestCase.tearDown(self)
def test_basic(self):
self.assertNotEqual(self.browser.dtds, [])

View File

@ -188,7 +188,9 @@ class Windows(BaseLib):
raise NoSuchWindowException("No window found for '{}'"
.format(target))
self.marionette.switch_to_window(target_handle)
# only switch if necessary
if target_handle != self.marionette.current_chrome_window_handle:
self.marionette.switch_to_window(target_handle)
return self.create_window_instance(target_handle)
@ -413,9 +415,7 @@ class BaseWindow(BaseLib):
keys.append(command_key.lower())
self.switch_to()
with self.marionette.using_context("chrome"):
self.window_element.send_keys(*keys)
self.window_element.send_keys(*keys)
def switch_to(self, focus=False):
"""Switches the context to this chrome window.