mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Bug 1243415 - Check for a valid DOMWindow for screenshot in chrome scope. r=automatedtester
By the webdriver spec the code has to fail with a NoSuchWindowError if the active window is no longer present. MozReview-Commit-ID: HFl7yO5ErRn --HG-- extra : rebase_source : d170e400c1624e680745e7023041413055ef9bd0
This commit is contained in:
parent
c4fb446f19
commit
f68eddf3dd
@ -2413,9 +2413,14 @@ GeckoDriver.prototype.takeScreenshot = function (cmd, resp) {
|
||||
switch (this.context) {
|
||||
case Context.CHROME:
|
||||
let canvas;
|
||||
let container = {frame: this.getCurrentWindow()};
|
||||
let highlightEls = [];
|
||||
|
||||
let container = {frame: this.getCurrentWindow().document.defaultView};
|
||||
|
||||
if (!container.frame) {
|
||||
throw new NoSuchWindowError('Unable to locate window');
|
||||
}
|
||||
|
||||
for (let h of highlights) {
|
||||
let el = this.curBrowser.seenEls.get(h, container);
|
||||
highlightEls.push(el);
|
||||
|
Loading…
Reference in New Issue
Block a user