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
Copy Markdown
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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'm not sure what you mean here since we already have some text listing the shortcuts:

Screenshot 2026-03-24 at 3 20 55 PM

'd': Download JSON results<br/>
's': Select various results for copy/paste (use repeatedly to cycle)
</p>
</div>
Expand Down
1 change: 0 additions & 1 deletion MotionMark/resources/debug-runner/motionmark.css
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@ body.showing-test-container.tiles-classic {
}

#overlay button {
margin: 2em auto;
border-color: rgb(241, 241, 241);
color: rgb(241, 241, 241);
}
Expand Down
12 changes: 12 additions & 0 deletions MotionMark/resources/runner/motionmark.css
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,18 @@ body.large .detail .large {
background: hsla(0, 0%, 100%, 0.9);
}

#overlay footer {
display: flex;
gap: 10px;
margin-top: 1.5em;
}

#overlay footer button {
flex: 1;
margin: 0;
box-sizing: border-box;
}

@supports (-webkit-backdrop-filter: blur(10px)) {
#overlay {
background: hsla(0, 0%, 100%, 0.7);
Expand Down
51 changes: 42 additions & 9 deletions MotionMark/resources/runner/motionmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class BenchmarkRunnerClient {
iterationCount = 1;
options = null;
results = null;

constructor(suites, options)
{
this.options = options;
Expand Down Expand Up @@ -133,7 +133,7 @@ class BenchmarkController {

await this.detectFrameRate();
}

async detectFrameRate(progressElement = undefined)
{
let targetFrameRate;
Expand All @@ -144,15 +144,15 @@ class BenchmarkController {
}
this.frameRateDeterminationComplete(targetFrameRate);
}

updateUIStrings()
{
document.title = Strings.text.title.replace("%s", Strings.version);
document.querySelectorAll(".version").forEach(function(e) {
e.textContent = Strings.version;
});
}

frameRateDeterminationComplete(frameRate)
{
const frameRateLabel = document.getElementById("frame-rate-label");
Expand All @@ -163,7 +163,7 @@ class BenchmarkController {
frameRate = 60;
} else if (frameRate != 60)
labelContent = Strings.text.non60FrameRate.replace("%s", frameRate);
else
else
labelContent = Strings.text.usingFrameRate.replace("%s", frameRate);

frameRateLabel.innerHTML = labelContent;
Expand Down Expand Up @@ -288,7 +288,7 @@ class BenchmarkController {

sectionsManager.showSection("test-container");
}

ensureRunnerClient(suites, options)
{
this.runnerClient = new benchmarkRunnerClientClass(suites, options);
Expand Down 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,41 @@ class BenchmarkController {
selection.addRange(range);
};

var button = Utilities.createElement("button", {}, container);
button.textContent = "Done";
button.onclick = () => {
const footer = Utilities.createElement("footer", {}, container);

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

const downloadButton = Utilities.createElement("button", {}, footer);
downloadButton.textContent = "Download";
downloadButton.onclick = () => {
this.downloadDebugInfo();
};
}

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

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

selectResults(target)
Expand Down