summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1')
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle-with-another-original.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle-with-another-original.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/iframe.html29
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/index.html74
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/onload.js21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/original-with-no-update.js9
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/original.js10
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query.js.x=11
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query.js.x=21
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query2.js.y=31
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/removed-original.js5
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/replaced-bundle.js2
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/replaced-bundle.js.map1
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/same-url.sjs20
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/script.js8
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/test-functions.js14
-rw-r--r--devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/webpack.config.js49
19 files changed, 251 insertions, 0 deletions
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle-with-another-original.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle-with-another-original.js
new file mode 100644
index 0000000000..777750fa7c
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle-with-another-original.js
@@ -0,0 +1,2 @@
+!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=0)}([function(e,n,t){e.exports=t(1)},function(e,n){window.baabar=function(){return new Promise(e=>setTimeout(e,100))},window.foobar=async function(){await baabar(),console.log("YO")},foobar()}]);
+//# sourceMappingURL=bundle-with-another-original.js.map \ No newline at end of file
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle-with-another-original.js.map b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle-with-another-original.js.map
new file mode 100644
index 0000000000..8eb982befc
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle-with-another-original.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./original-with-no-update.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","baabar","Promise","resolve","setTimeout","foobar","async","console","log"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gDClFrDC,OAAOC,OAAS,WACd,OAAO,IAAIC,QAAQC,GAAWC,WAAWD,EAAS,OAGpDH,OAAOK,OAASC,uBACRL,SACNM,QAAQC,IAAI,OAEdH","file":"bundle-with-another-original.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","window.baabar = function baabar() {\n return new Promise(resolve => setTimeout(resolve, 100))\n}\n\nwindow.foobar = async function foobar() {\n await baabar();\n console.log(\"YO\")\n}\nfoobar();\n"],"sourceRoot":""} \ No newline at end of file
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle.js
new file mode 100644
index 0000000000..1498d04c78
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle.js
@@ -0,0 +1,2 @@
+!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=0)}([function(e,n,t){e.exports=t(1)},function(e,n){window.bar=function(){return new Promise(e=>setTimeout(e,100))},window.foo=async function(){await nonSourceMappedFunction(),console.log("YO")}}]);
+//# sourceMappingURL=bundle.js.map \ No newline at end of file
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle.js.map b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle.js.map
new file mode 100644
index 0000000000..25fc347d3a
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/bundle.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./original.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","bar","Promise","resolve","setTimeout","foo","async","nonSourceMappedFunction","console","log"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gDClFrDC,OAAOC,IAAM,WACX,OAAO,IAAIC,QAAQC,GAAWC,WAAWD,EAAS,OAGpDH,OAAOK,IAAMC,uBAGLC,0BACNC,QAAQC,IAAI","file":"bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","window.bar = function bar() {\n return new Promise(resolve => setTimeout(resolve, 100))\n}\n\nwindow.foo = async function foo() {\n // This will call a function from script.js, itself calling a function\n // from original-with-query.js\n await nonSourceMappedFunction();\n console.log(\"YO\")\n}\n"],"sourceRoot":""} \ No newline at end of file
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/iframe.html b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/iframe.html
new file mode 100644
index 0000000000..c86cfd167c
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/iframe.html
@@ -0,0 +1,29 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ -->
+<!doctype html>
+
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Iframe v1</title>
+ </head>
+
+ <body>
+ <!-- A simple inline script, that helps to cover breakable lines/columns -->
+ <!-- Have them define first, so that we avoid shifting lines when adding new scripts later in the html -->
+ <script>
+ // Comment
+ console.log('iframe breakable-line');
+ </script>
+
+ <!-- A second inline script, that helps cover bugs when having two distinct inline scripts -->
+ <script>
+ // Another comment
+ console.log("second iframe inline script");
+ </script>
+
+ <!-- A script whose URL is loaded in many different ways -->
+ <script src="same-url.sjs"></script>
+ </body>
+
+</html>
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/index.html b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/index.html
new file mode 100644
index 0000000000..7fa9f4d306
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/index.html
@@ -0,0 +1,74 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ -->
+<!doctype html>
+
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Empty test page 1</title>
+ </head>
+
+ <body>
+ <!-- A simple inline script, that helps to cover breakable lines/columns -->
+ <!-- Have them define first, so that we avoid shifting lines when adding new scripts later in the html -->
+ <script>
+ // Comment
+ console.log('breakable-line');
+ </script>
+
+ <!-- A second inline script, that helps cover bugs when having two distinct inline scripts -->
+ <!-- And also covers inline script with column indexes being offseted by the HTML content -->
+ <script>console.log("second inline script");</script>
+
+ <!-- Covers column index being shifted only for the first line and normal for the subsequent ones -->
+ <script>console.log("third inline script");
+ eval(`
+ function nameLessEval() {
+ console.log("name-less-eval");
+ }
+ `);
+ eval(`
+ function namedEval() {
+ console.log("named-eval");
+ }
+ //# sourceURL=named-eval.js
+ `);
+ </script>
+
+ <!-- Test JS file with encoded characters as well as custom protocol -->
+ <script>
+ //# sourceURL=foo://bar/%e6%96%87%e5%ad%97%e3%82%b3%e3%83%bc%e3%83%89.js
+ </script>
+
+ <!-- A simple script -->
+ <script src="script.js"></script>
+ <!-- A script whose URL is shared by many other sources -->
+ <script src="same-url.sjs"></script>
+ <!-- A script running some various code on page load -->
+ <script src="onload.js"></script>
+ <!-- Another script containing helper functions trigerred by the tests -->
+ <script src="test-functions.js"></script>
+
+ <!-- Scripts with query strings -->
+ <!-- * same file, distinct query -->
+ <script src="query.js?x=1"></script>
+ <script src="query.js?x=2"></script>
+ <!-- * unique file -->
+ <script src="query2.js?y=3"></script>
+
+ <!-- A javascript: URL, which should not be shown in the SourceTree -->
+ <script src="javascript:console.log('foo')"></script>
+
+ <!-- A bundle/generated source that contains original.js -->
+ <script src="bundle.js"></script>
+
+ <!-- A bundle/generated source that contains original-with-no-update.js -->
+ <script src="bundle-with-another-original.js"></script>
+
+ <!-- Another bundle/generated source that contains removed-original.js -->
+ <script src="replaced-bundle.js"></script>
+
+ <iframe src="iframe.html"></script>
+ </body>
+
+</html>
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/onload.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/onload.js
new file mode 100644
index 0000000000..3e1ef7565d
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/onload.js
@@ -0,0 +1,21 @@
+
+/**
+ * Load the same url in many ways
+ */
+// 1) Notice in index.html the:
+// <script src="same-url.sjs"></script>
+
+// 2) Also the similar <script> tag in iframe.html
+
+// 3) Via a Worker, in a distinct target
+const worker = new Worker("same-url.sjs");
+worker.postMessage("foo");
+
+// 4) Via a named eval, in the same target
+// Hold a global reference to this function to avoid it from being GC-ed.
+this.evaled = eval("function sameUrlEval() {}; console.log('eval script'); //# sourceURL=same-url.sjs");
+
+// 5) Via a dynamically inserted <script>, in the same target
+const script = document.createElement("script");
+script.src = "same-url.sjs";
+document.body.appendChild(script);
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/original-with-no-update.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/original-with-no-update.js
new file mode 100644
index 0000000000..9fd6ecf110
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/original-with-no-update.js
@@ -0,0 +1,9 @@
+window.baabar = function baabar() {
+ return new Promise(resolve => setTimeout(resolve, 100))
+}
+
+window.foobar = async function foobar() {
+ await baabar();
+ console.log("YO")
+}
+foobar();
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/original.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/original.js
new file mode 100644
index 0000000000..9fbbc80ad3
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/original.js
@@ -0,0 +1,10 @@
+window.bar = function bar() {
+ return new Promise(resolve => setTimeout(resolve, 100))
+}
+
+window.foo = async function foo() {
+ // This will call a function from script.js, itself calling a function
+ // from original-with-query.js
+ await nonSourceMappedFunction();
+ console.log("YO")
+}
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query.js.x=1 b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query.js.x=1
new file mode 100644
index 0000000000..cee030ee1b
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query.js.x=1
@@ -0,0 +1 @@
+function query() {console.log("query x=1");}
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query.js.x=2 b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query.js.x=2
new file mode 100644
index 0000000000..d1d76705dd
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query.js.x=2
@@ -0,0 +1 @@
+function query() {console.log("query x=2");}
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query2.js.y=3 b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query2.js.y=3
new file mode 100644
index 0000000000..73b89a8972
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/query2.js.y=3
@@ -0,0 +1 @@
+function query() {console.log("query2 y=3");}
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/removed-original.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/removed-original.js
new file mode 100644
index 0000000000..df583abe4b
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/removed-original.js
@@ -0,0 +1,5 @@
+// Add two comment lines, to match the one from v2/new-original.js and have same....
+// breakpoint column positions.......................
+window.removedOriginal = function removedOriginal() {
+ console.log("Removed original");
+}
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/replaced-bundle.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/replaced-bundle.js
new file mode 100644
index 0000000000..0e3654072c
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/replaced-bundle.js
@@ -0,0 +1,2 @@
+!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=0)}([function(e,n,t){e.exports=t(1)},function(e,n){window.removedOriginal=function(){console.log("Removed original")}}]);
+//# sourceMappingURL=replaced-bundle.js.map \ No newline at end of file
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/replaced-bundle.js.map b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/replaced-bundle.js.map
new file mode 100644
index 0000000000..93e6472193
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/replaced-bundle.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./removed-original.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","removedOriginal","console","log"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gDChFrDC,OAAOC,gBAAkB,WACvBC,QAAQC,IAAI","file":"replaced-bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","// Add two comment lines, to match the one from v2/new-original.js and have same....\n// breakpoint column positions.......................\nwindow.removedOriginal = function removedOriginal() {\n console.log(\"Removed original\");\n}\n"],"sourceRoot":""} \ No newline at end of file
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/same-url.sjs b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/same-url.sjs
new file mode 100644
index 0000000000..b7d7ea64cb
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/same-url.sjs
@@ -0,0 +1,20 @@
+/* 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
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+"use strict";
+
+/**
+ * Serve a different content, each time it is loaded
+ */
+const contents = `console.log("Same url script #COUNTER");`;
+
+function handleRequest(request, response) {
+ response.setHeader("Cache-Control", "no-store");
+ response.setHeader("Content-Type", "application/javascript");
+
+ let counter = 1 + parseInt(getState("counter") || 0);
+ setState("counter", "" + counter);
+
+ response.write(contents.replace(/COUNTER/g, counter));
+}
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/script.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/script.js
new file mode 100644
index 0000000000..522fa404a0
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/script.js
@@ -0,0 +1,8 @@
+console.log("only one breakable line");
+// And one non-breakable line
+
+function nonSourceMappedFunction () {
+ console.log("non source mapped function");
+ // This will call a function from original-with-query.js
+ return originalWithQuery();
+}
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/test-functions.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/test-functions.js
new file mode 100644
index 0000000000..d81399b3fe
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/test-functions.js
@@ -0,0 +1,14 @@
+/**
+ * This file contains various test functions called by the test script via `await invokeInTab("functionName");`.
+ */
+function breakInEval() {
+ eval(`
+ debugger;
+
+ window.evaledFunc = function() {
+ var foo = 1;
+ var bar = 2;
+ return foo + bar;
+ };
+ `);
+}
diff --git a/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/webpack.config.js b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/webpack.config.js
new file mode 100644
index 0000000000..0c45c7e171
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/examples/sourcemaps-reload-compressed/v1/webpack.config.js
@@ -0,0 +1,49 @@
+const path = require("path");
+const webpack = require("webpack");
+
+const config = {
+ devtool: "sourcemap",
+};
+
+if (webpack.version && webpack.version[0] === "4") {
+ // Webpack 3, used in sourcemaps-reload-uncompressed, doesn't support mode attribute.
+ // Webpack 4, used in sourcemaps-reload-compressed we want production mode in order to compress the sources
+ config.mode = "production";
+} else {
+ // Also Webpack 4 doesn't support the module.loaders attribute
+ config.module = {
+ loaders: [
+ {
+ test: /\.js$/,
+ exclude: /node_modules/,
+ loader: "babel-loader",
+ },
+ ],
+ };
+}
+
+const originalBundle = Object.assign({}, config, {
+ entry: [path.join(__dirname, "original.js")],
+ output: {
+ path: __dirname,
+ filename: "bundle.js",
+ },
+});
+
+const bundleWithAnotherOriginalFile = Object.assign({}, config, {
+ entry: [path.join(__dirname, "original-with-no-update.js")],
+ output: {
+ path: __dirname,
+ filename: "bundle-with-another-original.js"
+ }
+});
+
+const replacedBundle = Object.assign({}, config, {
+ entry: [path.join(__dirname, "removed-original.js")],
+ output: {
+ path: __dirname,
+ filename: "replaced-bundle.js",
+ },
+});
+
+module.exports = [originalBundle, bundleWithAnotherOriginalFile, replacedBundle];