Bug 1373709 - Don't infinite loop when a test expects to crash, r=ato

In order to avoid the leak checker complaining about missing output,
we restart the browser before running tests that are expected to
crash. But as part of that restart we end up checking again if a
restart is required and so end up in an infinite loop. To break out of
that loop we simply check if this is the same test as during the last
iteration, and don't ask to restart in that case.

MozReview-Commit-ID: 90gsmqVCRsD

--HG--
extra : rebase_source : 9cf625e9cd1861b25b72e5c39ce070981b84046e
This commit is contained in:
James Graham 2017-06-16 16:34:44 +01:00
Родитель 1a8b5f9bbd
Коммит 981d317f0f
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -154,6 +154,7 @@ class BrowserManager(object):
self.browser = browser
self.no_timeout = no_timeout
self.browser_settings = None
self.last_test = None
self.started = False
@ -163,8 +164,9 @@ class BrowserManager(object):
browser_settings = self.browser.settings(test)
restart_required = ((self.browser_settings is not None and
self.browser_settings != browser_settings) or
test.expected() == "CRASH")
(self.last_test != test and test.expected() == "CRASH"))
self.browser_settings = browser_settings
self.last_test = test
return restart_required
def init(self):