tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_attach.js (1010B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 const { ThreadFront } = require("resource://devtools/client/fronts/thread.js");
      7 const {
      8  WindowGlobalTargetFront,
      9 } = require("resource://devtools/client/fronts/targets/window-global.js");
     10 
     11 /**
     12 * Very naive test that checks threadClearTest helper.
     13 * It ensures that the thread front is correctly attached.
     14 */
     15 add_task(
     16  threadFrontTest(({ threadFront, debuggee, client, targetFront }) => {
     17    ok(true, "Thread actor was able to attach");
     18    ok(threadFront instanceof ThreadFront, "Thread Front is valid");
     19    Assert.equal(threadFront.state, "attached", "Thread Front is resumed");
     20    Assert.equal(
     21      Cu.getSandboxMetadata(debuggee),
     22      undefined,
     23      "Debuggee client is valid (getSandboxMetadata did not fail)"
     24    );
     25    ok(client instanceof DevToolsClient, "Client is valid");
     26    ok(targetFront instanceof WindowGlobalTargetFront, "TargetFront is valid");
     27  })
     28 );