summaryrefslogtreecommitdiffstats
path: root/devtools/server/tests/browser/browser_inspector-utils.js
blob: ca4c78ffc5566cb4255d8febed60b8466a038b42 (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
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

/* import-globals-from inspector-helpers.js */
Services.scriptloader.loadSubScript(
  "chrome://mochitests/content/browser/devtools/server/tests/browser/inspector-helpers.js",
  this
);

const COLOR_WHITE = [255, 255, 255, 1];

add_task(async function loadNewChild() {
  const { walker } = await initInspectorFront(
    `data:text/html,<style>body{color:red;background-color:white;}body::before{content:"test";}</style>`
  );

  const body = await walker.querySelector(walker.rootNode, "body");
  const color = await body.getBackgroundColor();
  Assert.deepEqual(
    color.value,
    COLOR_WHITE,
    "Background color is calculated correctly for an element with a pseudo child."
  );
});