browser_shutdown_remote_only.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. 'use strict';
  5. add_task(function* () {
  6. // Making sure that the e10s is enabled on Windows for testing.
  7. yield setE10sPrefs();
  8. yield BrowserTestUtils.withNewTab({
  9. gBrowser,
  10. url: `data:text/html,
  11. <html>
  12. <head>
  13. <meta charset="utf-8"/>
  14. <title>Accessibility Test</title>
  15. </head>
  16. <body></body>
  17. </html>`
  18. }, function*(browser) {
  19. info('Creating a service in content');
  20. // Create a11y service in the content process.
  21. let a11yInit = initPromise(browser);
  22. loadFrameScripts(browser, `let accService = Components.classes[
  23. '@mozilla.org/accessibilityService;1'].getService(
  24. Components.interfaces.nsIAccessibilityService);`);
  25. yield a11yInit;
  26. info('Removing a service in content');
  27. // Remove a11y service reference from the content process.
  28. let a11yShutdown = shutdownPromise(browser);
  29. // Force garbage collection that should trigger shutdown.
  30. loadFrameScripts(browser, `accService = null; Components.utils.forceGC();`);
  31. yield a11yShutdown;
  32. // Unsetting e10s related preferences.
  33. yield unsetE10sPrefs();
  34. });
  35. });