in module/geb-core/src/main/groovy/geb/Browser.groovy [1015:1030]
protected <T> T doWithWindow(Map options, Closure<T> block) {
try {
if (options.page) {
verifyAtImplicitly(options.page)
}
Closure cloned = block.clone()
cloned.delegate = browser
cloned.resolveStrategy = DELEGATE_FIRST
cloned.call()
} finally {
if (options.close || (!options.containsKey(CLOSE_OPTION) && config.withWindowConfig.close)) {
getDriver().close()
}
}
}