summaryrefslogtreecommitdiffstats
path: root/devtools/client/aboutdebugging/test/xpcshell/test_extensions_path.js
blob: 1ec9f0d7c25a609efbad2c561c7e0a87d2198280 (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
/* global equal */

"use strict";

const {
  parseFileUri,
} = require("resource://devtools/client/aboutdebugging/src/modules/extensions-helper.js");

add_task(async function testParseFileUri() {
  equal(
    parseFileUri("file:///home/me/my-extension/"),
    "/home/me/my-extension/",
    "UNIX paths are supported"
  );

  equal(
    parseFileUri("file:///C:/Documents/my-extension/"),
    "C:/Documents/my-extension/",
    "Windows paths are supported"
  );

  equal(
    parseFileUri("file://home/Documents/my-extension/"),
    "home/Documents/my-extension/",
    "Windows network paths are supported"
  );
});