mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-19 15:51:33 +00:00
Bug 1723729 - Remove old Talos XPI generation scripts and documents. r=jmaher,perftest-reviewers,alexandru.irimovici
These documents and scripts were used to generate the add-ons for the tresize and tart Talos tests before the great WebExtension conversion. Nowadays, if people really want to install these tests locally, they can go to about:debugging, use Load Temprary Add-on, and browse to the manifest of the add-on folder. Depends on D122378 Differential Revision: https://phabricator.services.mozilla.com/D122379
This commit is contained in:
parent
7832d15b03
commit
3042fc0e10
@ -175,7 +175,6 @@ servo/
|
||||
# Test files that we don't want to lint (preprocessed, minified etc)
|
||||
testing/condprofile/condprof/tests/profile
|
||||
testing/mozbase/mozprofile/tests/files/prefs_with_comments.js
|
||||
testing/talos/talos/scripts/jszip.min.js
|
||||
testing/talos/talos/startup_test/sessionrestore/profile/sessionstore.js
|
||||
testing/talos/talos/startup_test/sessionrestore/profile-manywindows/sessionstore.js
|
||||
testing/talos/talos/tests/devtools/addon/content/pages/
|
||||
|
@ -1718,10 +1718,6 @@ In `bug
|
||||
tresize was rewritten to work in e10s mode which involved a full rewrite
|
||||
of the test.
|
||||
|
||||
To run resize locally without talos, please `install the
|
||||
addon <https://hg.mozilla.org/mozilla-central/raw-file/tip/testing/talos/talos/generate-tresize-xpi.html>`__
|
||||
to run the test locally.
|
||||
|
||||
**Example Data**
|
||||
|
||||
[23.2565333333333, 23.763383333333362, 22.58369999999999, 22.802766666666653, 22.304050000000025, 23.010383333333326, 22.865466666666677, 24.233716666666705, 24.110983333333365, 22.21390000000004, 23.910333333333316, 23.409816666666647, 19.873049999999992, 21.103966666666686, 20.389749999999978, 20.777349999999984, 20.326283333333365, 22.341616666666667, 20.29813333333336, 20.769600000000104]
|
||||
|
@ -1718,10 +1718,6 @@ In `bug
|
||||
tresize was rewritten to work in e10s mode which involved a full rewrite
|
||||
of the test.
|
||||
|
||||
To run resize locally without talos, please `install the
|
||||
addon <https://hg.mozilla.org/mozilla-central/raw-file/tip/testing/talos/talos/generate-tresize-xpi.html>`__
|
||||
to run the test locally.
|
||||
|
||||
**Example Data**
|
||||
|
||||
[23.2565333333333, 23.763383333333362, 22.58369999999999, 22.802766666666653, 22.304050000000025, 23.010383333333326, 22.865466666666677, 24.233716666666705, 24.110983333333365, 22.21390000000004, 23.910333333333316, 23.409816666666647, 19.873049999999992, 21.103966666666686, 20.389749999999978, 20.777349999999984, 20.326283333333365, 22.341616666666667, 20.29813333333336, 20.769600000000104]
|
||||
|
@ -1,81 +0,0 @@
|
||||
<html>
|
||||
<!--
|
||||
* 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/.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>TART addon xpi generator</title>
|
||||
<script src="scripts/jszip.min.js"></script>
|
||||
<script src="scripts/xpigen.js"></script>
|
||||
|
||||
<script>
|
||||
var base = "tests/tart/addon/";
|
||||
var files = [
|
||||
"bootstrap.js",
|
||||
"chrome.manifest",
|
||||
"install.rdf",
|
||||
"content/framescript.js",
|
||||
"content/tart.overlay.xul",
|
||||
"content/tart.html",
|
||||
"content/tart.ico",
|
||||
"content/tart.js",
|
||||
"content/blank.icon.html",
|
||||
"content/Profiler.js",
|
||||
"content/tab-min-width-1px.css",
|
||||
];
|
||||
|
||||
function triggerBuildXpi() {
|
||||
function $(id) { return document.getElementById(id); }
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
$("status-text").innerHTML = "Preparing ...";
|
||||
$("result").style.display = "none";
|
||||
$("status").style.display = "inline";
|
||||
|
||||
createXpiDataUri(base, files, {
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
onprogress(p) { $("status-text").innerHTML = "Preparing ... " + p.toFixed(0) + "%"; },
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
onerror(e) { $("status-text").innerHTML = "Oops, couldn't generate XPI. Reload to retry.<br/>" + e; },
|
||||
|
||||
onsuccess(u) {
|
||||
$("xpi-link").href = u;
|
||||
$("status").style.display = "none";
|
||||
$("result").style.display = "inline";
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="triggerBuildXpi()" style="font-family: sans-serif; color:#555">
|
||||
|
||||
<h3>TART addon</h3>
|
||||
<h4>
|
||||
Install / Download:
|
||||
<span id="status">
|
||||
<span id="status-text" style="color: #c40;">Not ready</span>
|
||||
</span>
|
||||
|
||||
<span id="result" style="display: none;">
|
||||
<a id="xpi-link" href="#" style="background-color: #dfd;">tart.xpi</a><br/>
|
||||
<span style="color: grey";>(gibberish file name is expected, just rename/save as tart.xpi)</span>
|
||||
</span>
|
||||
</h4>
|
||||
|
||||
<p>
|
||||
Once installed, to run TART tests, visit
|
||||
<span style="color: green; font-family: monospace;">chrome://tart/content/tart.html</span>
|
||||
and follow the instructions.
|
||||
</p>
|
||||
<p>
|
||||
You can also build the addon yourself on a local talos repo: zip the content
|
||||
of <span style="font-family: monospace;">talos/tests/tart/addon/</span> and rename the zip to xpi.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,77 +0,0 @@
|
||||
<html>
|
||||
<!--
|
||||
* 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/.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>Tresize addon xpi generator</title>
|
||||
<script src="scripts/jszip.min.js"></script>
|
||||
<script src="scripts/xpigen.js"></script>
|
||||
|
||||
<script>
|
||||
var base = "startup_test/tresize/addon/";
|
||||
var files = [
|
||||
"bootstrap.js",
|
||||
"chrome.manifest",
|
||||
"install.rdf",
|
||||
"content/framescript.js",
|
||||
"content/Profiler.js",
|
||||
"content/tresize.overlay.xul",
|
||||
"content/tresize.js",
|
||||
"content/tresize-test.html",
|
||||
];
|
||||
|
||||
function triggerBuildXpi() {
|
||||
function $(id) { return document.getElementById(id); }
|
||||
|
||||
$("status-text").innerHTML = "Preparing ...";
|
||||
$("result").style.display = "none";
|
||||
$("status").style.display = "inline";
|
||||
|
||||
createXpiDataUri(base, files, {
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
onprogress(p) { $("status-text").innerHTML = "Preparing ... " + p.toFixed(0) + "%"; },
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
onerror(e) { $("status-text").innerHTML = "Oops, couldn't generate XPI. Reload to retry.<br/>" + e; },
|
||||
|
||||
onsuccess(u) {
|
||||
$("xpi-link").href = u;
|
||||
$("status").style.display = "none";
|
||||
$("result").style.display = "inline";
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="triggerBuildXpi()" style="font-family: sans-serif; color:#555">
|
||||
|
||||
<h3>TResize addon</h3>
|
||||
<h4>
|
||||
Install / Download:
|
||||
<span id="status">
|
||||
<span id="status-text" style="color: #c40;">Not ready</span>
|
||||
</span>
|
||||
|
||||
<span id="result" style="display: none;">
|
||||
<a id="xpi-link" href="#" style="background-color: #dfd;">tresize.xpi</a><br/>
|
||||
<span style="color: grey";>(gibberish file name is expected, just rename/save as tresize.xpi)</span>
|
||||
</span>
|
||||
</h4>
|
||||
|
||||
<p>
|
||||
Once installed, to run Tresize tests, visit
|
||||
<span style="color: green; font-family: monospace;">chrome://tresize/content/tresize-test.html</span>
|
||||
and follow the instructions.
|
||||
</p>
|
||||
<p>
|
||||
You can also build the addon yourself on a local talos repo: zip the content
|
||||
of <span style="font-family: monospace;">talos/statup_test/tresize/addon/</span> and rename the zip to xpi.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
14
testing/talos/talos/scripts/jszip.min.js
vendored
14
testing/talos/talos/scripts/jszip.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,103 +0,0 @@
|
||||
/* 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/. */
|
||||
|
||||
/* globals JSZip */
|
||||
|
||||
/* eslint-disable no-nested-ternary */
|
||||
|
||||
// base: relative or absolute path (http[s] or file, untested with ftp)
|
||||
// files: array of file names relative to base to include at the zip
|
||||
// callbacks: object with optional functions:
|
||||
// onsuccess(result), onerror(exception), onprogress(percentage)
|
||||
function createXpiDataUri(base, files, callbacks) {
|
||||
// Synchronous XHR for http[s]/file (untested ftp), throws on any error
|
||||
// Note that on firefox, file:// XHR can't access files outside base dir
|
||||
function readBinFile(url) {
|
||||
var r = new XMLHttpRequest();
|
||||
r.open("GET", url, false);
|
||||
r.requestType = "arraybuffer";
|
||||
r.overrideMimeType("text/plain; charset=x-user-defined");
|
||||
try {
|
||||
r.send();
|
||||
} catch (e) {
|
||||
throw new Error(`FileNotRetrieved: ${url} - ${e}`);
|
||||
}
|
||||
// For 'file://' Firefox sets status=0 on success or throws otherwise
|
||||
// In Firefox 34-ish onwards, success status is 200.
|
||||
if (!(r.readyState == 4 && (r.status == 0 || r.status == 200))) {
|
||||
throw new Error(`FileNotRetrieved: ${url} - ${r.status} ${r.statusText}`);
|
||||
}
|
||||
|
||||
return r.response;
|
||||
}
|
||||
|
||||
// Create base64 string for a binary array (btoa fails on arbitrary binary data)
|
||||
function base64EncArr(aBytes) {
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding
|
||||
"use strict;";
|
||||
function uint6ToB64(nUint6) {
|
||||
return nUint6 < 26
|
||||
? nUint6 + 65
|
||||
: nUint6 < 52
|
||||
? nUint6 + 71
|
||||
: nUint6 < 62
|
||||
? nUint6 - 4
|
||||
: nUint6 === 62
|
||||
? 43
|
||||
: nUint6 === 63
|
||||
? 47
|
||||
: 65;
|
||||
}
|
||||
|
||||
var nMod3 = 2,
|
||||
sB64Enc = "";
|
||||
for (var nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) {
|
||||
nMod3 = nIdx % 3;
|
||||
if (nIdx > 0 && ((nIdx * 4) / 3) % 76 === 0) {
|
||||
sB64Enc += "\r\n";
|
||||
}
|
||||
nUint24 |= aBytes[nIdx] << ((16 >>> nMod3) & 24);
|
||||
if (nMod3 === 2 || aBytes.length - nIdx === 1) {
|
||||
sB64Enc += String.fromCharCode(
|
||||
uint6ToB64((nUint24 >>> 18) & 63),
|
||||
uint6ToB64((nUint24 >>> 12) & 63),
|
||||
uint6ToB64((nUint24 >>> 6) & 63),
|
||||
uint6ToB64(nUint24 & 63)
|
||||
);
|
||||
nUint24 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
sB64Enc.substr(0, sB64Enc.length - 2 + nMod3) +
|
||||
(nMod3 === 2 ? "" : nMod3 === 1 ? "=" : "==")
|
||||
);
|
||||
}
|
||||
|
||||
// Create the zip/xpi
|
||||
try {
|
||||
function dummy() {}
|
||||
var onsuccess = callbacks.onsuccess || dummy;
|
||||
var onerror = callbacks.onerror || dummy;
|
||||
var onprogress = callbacks.onprogress || dummy;
|
||||
|
||||
var zip = new JSZip();
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
zip.file(files[i], readBinFile(base + files[i]), {
|
||||
binary: true,
|
||||
compression: "deflate",
|
||||
});
|
||||
onprogress((100 * (i + 1)) / (files.length + 1));
|
||||
}
|
||||
zip = zip.generate({ type: "uint8array" });
|
||||
onprogress(100);
|
||||
setTimeout(
|
||||
onsuccess,
|
||||
0,
|
||||
"data:application/x-xpinstall;base64," + base64EncArr(zip)
|
||||
);
|
||||
} catch (e) {
|
||||
setTimeout(onerror, 0, e);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user