2017-02-17 22:22:45 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Bug 1336811 - An XHR that has a .onreadystatechange waiting should
|
|
|
|
// not leak forever once the tab is closed. CC optimizations need to be
|
|
|
|
// turned off once it is closed.
|
|
|
|
|
2017-06-22 13:51:42 +03:00
|
|
|
add_task(async function test() {
|
2017-02-17 22:22:45 +03:00
|
|
|
const url = "http://mochi.test:8888/browser/dom/xhr/tests/browser_xhr_onchange_leak.html";
|
2017-06-22 13:51:42 +03:00
|
|
|
let newTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
|
2017-02-17 22:22:45 +03:00
|
|
|
let browser = gBrowser.selectedBrowser;
|
2018-07-21 01:49:59 +03:00
|
|
|
let done = await ContentTask.spawn(browser, {}, async function(browser) {
|
2017-02-17 22:22:45 +03:00
|
|
|
let doc = content.document;
|
|
|
|
let promise = ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", true);
|
2018-07-21 01:49:59 +03:00
|
|
|
content.location = "http://example.org/";
|
2017-06-22 13:51:42 +03:00
|
|
|
await promise;
|
2017-02-17 22:22:45 +03:00
|
|
|
return true;
|
|
|
|
});
|
|
|
|
is(done, true, "need to check something");
|
2018-03-19 05:16:45 +03:00
|
|
|
BrowserTestUtils.removeTab(newTab);
|
2017-02-17 22:22:45 +03:00
|
|
|
});
|