Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MotionMark/developer.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ <h1>MotionMark score</h1>
<button onclick="benchmarkController.restartBenchmark()">Test Again</button>
<p>
'j': Show JSON results<br/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should show small gray text that lists these shortcuts on the end screen.

'd': Download JSON results<br/>
's': Select various results for copy/paste (use repeatedly to cycle)
</p>
</div>
Expand Down
37 changes: 34 additions & 3 deletions MotionMark/resources/runner/motionmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ class BenchmarkController {
case 106: // j
benchmarkController.showDebugInfo();
break;
case 100: // d
benchmarkController.downloadDebugInfo();
break;
case 115: // s
benchmarkController.selectResults(event.target);
break;
Expand Down Expand Up @@ -380,11 +383,39 @@ class BenchmarkController {
selection.addRange(range);
};

var button = Utilities.createElement("button", {}, container);
button.textContent = "Done";
button.onclick = () => {
var doneButton = Utilities.createElement("button", {}, container);
doneButton.textContent = "Done";
doneButton.onclick = () => {
this.hideDebugInfo();
};

var downloadButton = Utilities.createElement("button", {}, container);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use const here and above.

downloadButton.textContent = "Download";
downloadButton.onclick = () => {
this.downloadDebugInfo();
};
}

downloadDebugInfo()
{
var output = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let/const

version: this.runnerClient.scoreCalculator.version,
options: this.runnerClient.scoreCalculator.options,
data: this.runnerClient.scoreCalculator.data
};
var json = JSON.stringify(output, (key, value) => {
if (typeof value === 'number')
return Utilities.toFixedNumber(value, 3);
return value;
}, 1);
var blob = new Blob([json], { type: "application/json" });
var url = URL.createObjectURL(blob);

var a = document.createElement('a');
a.href = url;
a.download = 'motionmark-results.json';
a.click();
URL.revokeObjectURL(url);
}

selectResults(target)
Expand Down