summaryrefslogtreecommitdiffstats
path: root/devtools/shared/tests/xpcshell/test_require_raw.js
blob: acd0e374b168cc245ef66efd9505ab27f85b915f (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";

// Test require using "raw!".

function run_test() {
  const loader = new DevToolsLoader();
  const require = loader.require;

  const variableFileContents = require("raw!chrome://devtools/skin/variables.css");
  ok(!!variableFileContents.length, "raw browserRequire worked");

  const propertiesFileContents = require("raw!devtools/client/locales/shared.properties");
  ok(
    !!propertiesFileContents.length,
    "unprefixed properties raw require worked"
  );

  const chromePropertiesFileContents = require("raw!chrome://devtools/locale/shared.properties");
  ok(
    !!chromePropertiesFileContents.length,
    "prefixed properties raw require worked"
  );
}