Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2828)

Unified Diff: chrome/test/data/third_party/spaceport/js/fullReport.js

Issue 10154006: Add test data for spaceport benchmark. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
+ };
+});
« no previous file with comments | « chrome/test/data/third_party/spaceport/js/features.js ('k') | chrome/test/data/third_party/spaceport/js/index.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698