зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1386828 - Use marionette.close to close tabs. r=whimboo
MozReview-Commit-ID: AL5yTSbX5Mn
This commit is contained in:
Родитель
24f4ad254e
Коммит
3b76eb5771
|
@ -108,20 +108,10 @@ class TestMemoryUsage(MarionetteTestCase):
|
||||||
self._pages_loaded = 0
|
self._pages_loaded = 0
|
||||||
|
|
||||||
# Close all tabs except one
|
# Close all tabs except one
|
||||||
for x in range(len(self.marionette.window_handles) - 1):
|
for x in self.marionette.window_handles[1:]:
|
||||||
self.logger.info("closing window")
|
self.logger.info("closing window: %s" % x)
|
||||||
try:
|
self.marionette.switch_to_window(x)
|
||||||
result = self.marionette.execute_script("gBrowser.removeCurrentTab();",
|
self.marionette.close()
|
||||||
script_timeout=180000)
|
|
||||||
except JavascriptException, e:
|
|
||||||
self.logger.error("gBrowser.removeCurrentTab() JavaScript error: %s" % e)
|
|
||||||
except ScriptTimeoutException:
|
|
||||||
self.logger.error("gBrowser.removeCurrentTab() timed out")
|
|
||||||
except:
|
|
||||||
self.logger.error("gBrowser.removeCurrentTab() Unexpected error: %s" % sys.exc_info()[0])
|
|
||||||
else:
|
|
||||||
self.logger.info(result)
|
|
||||||
time.sleep(0.25)
|
|
||||||
|
|
||||||
self._tabs = self.marionette.window_handles
|
self._tabs = self.marionette.window_handles
|
||||||
self.marionette.switch_to_window(self._tabs[0])
|
self.marionette.switch_to_window(self._tabs[0])
|
||||||
|
|
Загрузка…
Ссылка в новой задаче