summaryrefslogtreecommitdiffstats
path: root/devtools/server/tests/unit/test_promises_actor_exist.js
blob: 13eef3e9936a2674fa28f7a46bac957784c34a86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

/**
 * Test that the PromisesActor exists in the TabActors and ChromeActors.
 */

add_task(function* () {
  let client = yield startTestDebuggerServer("promises-actor-test");

  let response = yield listTabs(client);
  let targetTab = findTab(response.tabs, "promises-actor-test");
  ok(targetTab, "Found our target tab.");

  // Attach to the TabActor and check the response
  client.request({ to: targetTab.actor, type: "attach" }, response => {
    ok(!("error" in response), "Expect no error in response.");
    ok(response.from, targetTab.actor,
      "Expect the target TabActor in response form field.");
    ok(response.type, "tabAttached",
      "Expect tabAttached in the response type.");
    is(typeof response.promisesActor === "string",
      "Should have a tab context PromisesActor.");
  });

  let chromeActors = yield getChromeActors(client);
  ok(typeof chromeActors.promisesActor === "string",
    "Should have a chrome context PromisesActor.");
});