browser_xhr_onchange_leak.js 975 B

123456789101112131415161718192021222324
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  4. */
  5. // Bug 1336811 - An XHR that has a .onreadystatechange waiting should
  6. // not leak forever once the tab is closed. CC optimizations need to be
  7. // turned off once it is closed.
  8. add_task(function* test() {
  9. const url = "http://mochi.test:8888/browser/dom/xhr/tests/browser_xhr_onchange_leak.html";
  10. let newTab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url);
  11. let browser = gBrowser.selectedBrowser;
  12. let done = yield ContentTask.spawn(browser,{}, function*(browser){
  13. let doc = content.document;
  14. let promise = ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", true);
  15. content.location = "about:home";
  16. yield promise;
  17. return true;
  18. });
  19. is(done, true, "need to check something");
  20. yield BrowserTestUtils.removeTab(newTab);
  21. });