browser_target_remote.js 595 B

12345678910111213141516171819202122232425
  1. /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
  2. /* Any copyright is dedicated to the Public Domain.
  3. * http://creativecommons.org/publicdomain/zero/1.0/ */
  4. // Ensure target is closed if client is closed directly
  5. function test() {
  6. waitForExplicitFinish();
  7. getChromeActors((client, response) => {
  8. let options = {
  9. form: response,
  10. client: client,
  11. chrome: true
  12. };
  13. TargetFactory.forRemoteTab(options).then(target => {
  14. target.on("close", () => {
  15. ok(true, "Target was closed");
  16. finish();
  17. });
  18. client.close();
  19. });
  20. });
  21. }