summaryrefslogtreecommitdiffstats
path: root/devtools/client/shared/source-map-loader/test/browser/head.js
blob: 0f54e5a5f5ee8d3b29d0d6e5b24a6573490ae380 (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
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

Services.scriptloader.loadSubScript(
  "chrome://mochitests/content/browser/devtools/client/shared/test/shared-head.js",
  this
);

const {
  SourceMapLoader,
} = require("resource://devtools/client/shared/source-map-loader/index.js");

const gSourceMapLoader = new SourceMapLoader();

function fetchFixtureSourceMap(name) {
  gSourceMapLoader.clearSourceMaps();

  const source = {
    id: `${name}.js`,
    sourceMapURL: `${name}.js.map`,
    sourceMapBaseURL: `${URL_ROOT_SSL}fixtures/${name}.js`,
  };

  return gSourceMapLoader.getOriginalURLs(source);
}