Bug 1299587 - Handle if marionette tests can't focus mainFrame in tearDown. r=automatedtester

It's possible the mainFrame has already been closed in which case it can
become a dead wrapper. Just gracefully handle failure in this situation.
This commit is contained in:
Eric Rahm 2016-09-01 13:30:24 -07:00
Родитель 4061321fa2
Коммит 6a06f03938
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -2268,7 +2268,12 @@ GeckoDriver.prototype.sessionTearDown = function(cmd, resp) {
// reset frame to the top-most frame
this.curFrame = null;
if (this.mainFrame) {
this.mainFrame.focus();
try {
this.mainFrame.focus();
}
catch (e) {
this.mainFrame = null;
}
}
this.sessionId = null;