diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /netwerk/test/mochitests/web_packaged_app.sjs | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'netwerk/test/mochitests/web_packaged_app.sjs')
-rw-r--r-- | netwerk/test/mochitests/web_packaged_app.sjs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/netwerk/test/mochitests/web_packaged_app.sjs b/netwerk/test/mochitests/web_packaged_app.sjs new file mode 100644 index 000000000..d5587d8d7 --- /dev/null +++ b/netwerk/test/mochitests/web_packaged_app.sjs @@ -0,0 +1,35 @@ +var Cc = Components.classes; +var Ci = Components.interfaces; +var Cu = Components.utils; + +function handleRequest(request, response) +{ + response.setHeader("Content-Type", "application/package", false); + response.write(octetStreamData.getData()); + return; +} + +// The package content +// getData formats it as described at http://www.w3.org/TR/web-packaging/#streamable-package-format +var octetStreamData = { + content: [ + { headers: ["Content-Location: /index.html", "Content-Type: text/html"], data: "<html>\r\n <head>\r\n <script> alert('OK: hello'); alert('DONE'); </script>\r\n</head>\r\n Web Packaged App Index\r\n</html>\r\n", type: "text/html" }, + { headers: ["Content-Location: /scripts/app.js", "Content-Type: text/javascript"], data: "module Math from '/scripts/helpers/math.js';\r\n...\r\n", type: "text/javascript" }, + { headers: ["Content-Location: /scripts/helpers/math.js", "Content-Type: text/javascript"], data: "export function sum(nums) { ... }\r\n...\r\n", type: "text/javascript" } + ], + token : "gc0pJq0M:08jU534c0p", + getData: function() { + var str = ""; + for (var i in this.content) { + str += "--" + this.token + "\r\n"; + for (var j in this.content[i].headers) { + str += this.content[i].headers[j] + "\r\n"; + } + str += "\r\n"; + str += this.content[i].data + "\r\n"; + } + + str += "--" + this.token + "--"; + return str; + } +} |