Bug 1370507 - browser_all_files_referenced.js should be able to handle template strings. r=florian

MozReview-Commit-ID: FQZjG1i0ddk
This commit is contained in:
Mark Banner 2017-06-06 12:45:29 +01:00
Родитель 2e836194b0
Коммит e82e58aff9
1 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -1,6 +1,10 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
// Note to run this test similar to try server, you need to run:
// ./mach package
// ./mach mochitest --appname dist <path to test>
// Slow on asan builds. // Slow on asan builds.
requestLongerTimeout(5); requestLongerTimeout(5);
@ -324,7 +328,7 @@ function parseCodeFile(fileUri) {
let baseUri; let baseUri;
for (let line of data.split("\n")) { for (let line of data.split("\n")) {
let urls = let urls =
line.match(/["']chrome:\/\/[a-zA-Z0-9 -]+\/(content|skin|locale)\/[^"' ]*["']/g); line.match(/["'`]chrome:\/\/[a-zA-Z0-9 -]+\/(content|skin|locale)\/[^"'` ]*["'`]/g);
if (!urls) { if (!urls) {
urls = line.match(/["']resource:\/\/[^"']+["']/g); urls = line.match(/["']resource:\/\/[^"']+["']/g);
if (urls && isDevtools && if (urls && isDevtools &&
@ -388,8 +392,14 @@ function parseCodeFile(fileUri) {
// Remove quotes. // Remove quotes.
url = url.slice(1, -1); url = url.slice(1, -1);
// Remove ? or \ trailing characters. // Remove ? or \ trailing characters.
if (url.endsWith("?") || url.endsWith("\\")) if (url.endsWith("\\")) {
url = url.slice(0, -1); url = url.slice(0, -1);
}
let pos = url.indexOf("?");
if (pos != -1) {
url = url.slice(0, pos);
}
// Make urls like chrome://browser/skin/ point to an actual file, // Make urls like chrome://browser/skin/ point to an actual file,
// and remove the ref if any. // and remove the ref if any.