| Index: chrome/test/data/third_party/spaceport/js/fullReport.js
|
| diff --git a/chrome/test/data/third_party/spaceport/js/fullReport.js b/chrome/test/data/third_party/spaceport/js/fullReport.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c768bd97f138d4bffceb41c484f34f816941ea5b
|
| --- /dev/null
|
| +++ b/chrome/test/data/third_party/spaceport/js/fullReport.js
|
| @@ -0,0 +1,45 @@
|
| +define([ 'tables', 'util/report' ], function (tables, report) {
|
| + function val(id) {
|
| + var el = document.getElementById(id);
|
| + var customEl = document.getElementById(id + '-custom');
|
| +
|
| + return el.value || (customEl && customEl.value);
|
| + }
|
| +
|
| + function getAgentMetadata() {
|
| + if (typeof window !== 'undefined' && window) {
|
| + return {
|
| + userAgent: window.navigator.userAgent,
|
| + language: window.navigator.language,
|
| + browser: val('ua-browser'),
|
| + name: val('ua-device-name'),
|
| + os: val('ua-os'),
|
| + type: val('ua-type'),
|
| + misc: val('ua-misc')
|
| + };
|
| + } else {
|
| + return null;
|
| + }
|
| + }
|
| +
|
| + function csvReport(results, agentMetadata) {
|
| + agentMetadata = agentMetadata || getAgentMetadata();
|
| +
|
| + var reports = [ ];
|
| + if (agentMetadata) {
|
| + reports.push(report.csvByObject(agentMetadata));
|
| + }
|
| +
|
| + Object.keys(tables.performance).forEach(function (testName) {
|
| + var layout = report.makeTableLayout(tables.performance[testName]);
|
| + reports.push(report.csvByLayout(results[testName], layout, [ testName ]));
|
| + });
|
| +
|
| + return reports.join('\n\n') + '\n';
|
| + }
|
| +
|
| + return {
|
| + csvReport: csvReport,
|
| + getAgentMetadata: getAgentMetadata
|
| + };
|
| +});
|
|
|