browser/devtools/framework/test/browser_target_remote.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 3
michael@0 4 let { DebuggerServer } =
michael@0 5 Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
michael@0 6 let { DebuggerClient } =
michael@0 7 Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
michael@0 8 let { devtools } =
michael@0 9 Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
michael@0 10
michael@0 11 // Ensure target is closed if client is closed directly
michael@0 12 function test() {
michael@0 13 waitForExplicitFinish();
michael@0 14
michael@0 15 if (!DebuggerServer.initialized) {
michael@0 16 DebuggerServer.init(function () { return true; });
michael@0 17 DebuggerServer.addBrowserActors();
michael@0 18 }
michael@0 19
michael@0 20 var client = new DebuggerClient(DebuggerServer.connectPipe());
michael@0 21 client.connect(() => {
michael@0 22 client.listTabs(response => {
michael@0 23 let options = {
michael@0 24 form: response,
michael@0 25 client: client,
michael@0 26 chrome: true
michael@0 27 };
michael@0 28
michael@0 29 devtools.TargetFactory.forRemoteTab(options).then(target => {
michael@0 30 target.on("close", () => {
michael@0 31 ok(true, "Target was closed");
michael@0 32 DebuggerServer.destroy();
michael@0 33 finish();
michael@0 34 });
michael@0 35 client.close();
michael@0 36 });
michael@0 37 });
michael@0 38 });
michael@0 39 }

mercurial