summaryrefslogtreecommitdiffstats
path: root/devtools/client/styleeditor/test/browser_styleeditor_import_rule.js
blob: 1aba71634c110f5c7edbf619b4a47acc117ec778 (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
30
31
32
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";

// Test that style editor shows sheets loaded with @import rules.

// http rather than chrome to improve coverage
const TESTCASE_URI = TEST_BASE_HTTPS + "import.html";

add_task(async function () {
  const { ui } = await openStyleEditorForURL(TESTCASE_URI);

  is(ui.editors.length, 3, "there are 3 stylesheets after loading @imports");

  is(
    ui.editors[0].styleSheet.href,
    TEST_BASE_HTTPS + "simple.css",
    "stylesheet 1 is simple.css"
  );

  is(
    ui.editors[1].styleSheet.href,
    TEST_BASE_HTTPS + "import.css",
    "stylesheet 2 is import.css"
  );

  is(
    ui.editors[2].styleSheet.href,
    TEST_BASE_HTTPS + "import2.css",
    "stylesheet 3 is import2.css"
  );
});