mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1288440 P4 Test that sdk/window/events does not leak existing windows. r=gabor
This commit is contained in:
parent
9027cc8e21
commit
921a58dfb2
@ -44,4 +44,22 @@ exports["test window/events for leaks"] = function*(assert) {
|
||||
});
|
||||
};
|
||||
|
||||
exports["test window/events for leaks with existing window"] = function*(assert) {
|
||||
yield asyncWindowLeakTest(assert, _ => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let loader = Loader(module);
|
||||
let w = open();
|
||||
w.addEventListener("load", function windowLoaded(evt) {
|
||||
w.removeEventListener("load", windowLoaded);
|
||||
let { events } = loader.require("sdk/window/events");
|
||||
w.addEventListener("DOMWindowClose", function windowClosed(evt) {
|
||||
w.removeEventListener("DOMWindowClose", windowClosed);
|
||||
resolve(loader);
|
||||
});
|
||||
w.close();
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
require("sdk/test").run(exports);
|
||||
|
Loading…
Reference in New Issue
Block a user