summaryrefslogtreecommitdiffstats
path: root/devtools/shared/tests/xpcshell/test_require_raw.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /devtools/shared/tests/xpcshell/test_require_raw.js
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/shared/tests/xpcshell/test_require_raw.js')
-rw-r--r--devtools/shared/tests/xpcshell/test_require_raw.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/devtools/shared/tests/xpcshell/test_require_raw.js b/devtools/shared/tests/xpcshell/test_require_raw.js
new file mode 100644
index 0000000000..acd0e374b1
--- /dev/null
+++ b/devtools/shared/tests/xpcshell/test_require_raw.js
@@ -0,0 +1,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"
+ );
+}