зеркало из https://github.com/github/fetch.git
Remove test that depends on specific abortcontroller-polyfill API
`signal.listeners` is not available in native implementations of AbortSignal.
This commit is contained in:
Родитель
fd151e986a
Коммит
b7ea5f2c38
33
test/test.js
33
test/test.js
|
@ -1149,39 +1149,6 @@ exercise.forEach(function(exerciseMode) {
|
|||
)
|
||||
])
|
||||
})
|
||||
|
||||
test('does not leak memory', function() {
|
||||
var controller = new AbortController()
|
||||
var signal = controller.signal
|
||||
|
||||
// success
|
||||
return fetch('/request', {
|
||||
signal: signal
|
||||
})
|
||||
.then(function() {
|
||||
assert.deepEqual(signal.listeners['abort'], [])
|
||||
})
|
||||
.then(function() {
|
||||
// failure
|
||||
return fetch('/boom', {
|
||||
signal: signal
|
||||
}).catch(function() {
|
||||
assert.deepEqual(signal.listeners['abort'], [])
|
||||
})
|
||||
})
|
||||
.then(function() {
|
||||
// aborted
|
||||
setTimeout(function() {
|
||||
signal.dispatchEvent({type: 'abort'})
|
||||
}, 30)
|
||||
|
||||
return fetch('/slow', {
|
||||
signal: signal
|
||||
}).catch(function() {
|
||||
assert.deepEqual(signal.listeners['abort'], [])
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
suite('response', function() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче