Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'android'
- Manifest: devtools/client/debugger/test/xpcshell/xpcshell.toml
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
"use strict";
const { require } = ChromeUtils.importESModule(
"resource://devtools/shared/loader/Loader.sys.mjs"
);
const {
getRelativePath,
} = require("devtools/client/debugger/src/utils/sources-tree/utils");
function run_test() {
info("Test a url without any path");
equal(
"(index)",
"Returns a string representing the index file"
);
info("Test a url with directory path");
equal(
"path/",
"Returns the directory path"
);
info("Test a http url a simple file path with no extension");
equal(
"file",
"Returns the simple path"
);
info("Test a file url with a multi directory file path with no extension");
equal(
"path/to/file",
"Returns the full file path"
);
info("Test a http url which is multi directory with html file path");
equal(
"path/to/file.html",
"Returns the full html file path"
);
info("Test a http url which is multi directory with js file path");
equal(
"path/to/file.js",
"Returns the full js file path"
);
info("Test a file url with path and query parameters");
equal(
"path/to/file.js",
"Returns the full path without the query params"
);
info("Test a webpack url with path and fragment");
equal(
"path/to/file.js",
"Returns the full path without the query params"
);
}