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
38 changes: 37 additions & 1 deletion MotionMark/developer.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ <h2>version <span class="version"></span></h2>
<div id="suites">
<h2>Suites:</h2>
<ul class="tree"></ul>
<div><span id="drop-target">Drop results here</span></div>
<div>
<span id="drop-target">Drop results here</span>
<button id="load-results-button" onclick="benchmarkController.loadResults()">Load results…</button>
<input type="file" id="load-results-input" style="display: none;"
onchange="benchmarkController.handleResultsFile(this)">
</div>
</div>
<div id="options">
<h2>Options:</h2>
Expand Down Expand Up @@ -104,6 +109,16 @@ <h3>Adjusting the test complexity:</h3>
<label>Target frame rate: <input type="number" id="frame-rate" value="60"> FPS</label>
</li>
<li>
<label>Score profile:
<select name="score-profile" id="score-profile">
<option value="slope">Slope</option>
<option value="flat">Flat</option>
<option value="window">Windowed</option>
<option value="window-strict">Windowed Strict</option>
</select>
</label>
</li>
<li>
<h3>Time measurement method:</h3>
<ul>
<li><label><input name="time-measurement" type="radio" value="performance" checked> <code>performance.now()</code> (if available)</label></li>
Expand Down Expand Up @@ -147,6 +162,16 @@ <h1>MotionMark score</h1>
</div>
<div>version <span class="version"></span></div>
<p class="score" onclick="benchmarkController.showDebugInfo()"></p>
<div class="score-profile">
<label>Score profile:
<select id="results-score-profile" onchange="benchmarkController.changeScoreProfile(this.value)">
<option value="slope">Slope</option>
<option value="flat">Flat</option>
<option value="window">Windowed</option>
<option value="window-strict">Windowed Strict</option>
</select>
</label>
</div>
<p class="confidence"></p>
<div id="results-tables" class="table-container">
<div>
Expand All @@ -158,6 +183,7 @@ <h1>MotionMark score</h1>
<button onclick="benchmarkController.restartBenchmark()">Test Again</button>
<p>
'j': Show JSON results<br/>
'd': Download JSON results<br/>
's': Select various results for copy/paste (use repeatedly to cycle)
</p>
</div>
Expand All @@ -168,6 +194,16 @@ <h1>MotionMark score</h1>
<button onclick="benchmarkController.showResults()">&lt; Results</button>
<h1>Graph:</h1>
<p class="score">&nbsp;</p>
<div class="score-profile">
<label>Score profile:
<select id="graph-score-profile" onchange="benchmarkController.changeScoreProfile(this.value)">
<option value="slope">Slope</option>
<option value="flat">Flat</option>
<option value="window">Windowed</option>
<option value="window-strict">Windowed Strict</option>
</select>
</label>
</div>
<p class="confidence">&nbsp;</p>
</header>
<nav>
Expand Down
88 changes: 66 additions & 22 deletions MotionMark/resources/debug-runner/debug-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ class DebugBenchmarkController extends BenchmarkController {
let progressElement = document.querySelector("#frame-rate-detection span");
await this.detectFrameRate(progressElement);
}

#setupDropTarget()
{
var dropTarget = document.getElementById("drop-target");
Expand Down Expand Up @@ -587,34 +587,38 @@ class DebugBenchmarkController extends BenchmarkController {
}

dropTarget.textContent = 'Processing…';
this.handleResultsFile(e.dataTransfer.files[0]);
}, false);
}

var file = e.dataTransfer.files[0];

var reader = new FileReader();
reader.filename = file.name;
reader.onload = (e) => {
const data = JSON.parse(e.target.result);

let results;
if (data['debugOutput'] instanceof Array)
results = RunData.resultsDataFromBenchmarkRunnerData(data['debugOutput']);
else
results = RunData.resultsDataFromSingleRunData(data);
loadResults() {
document.getElementById("load-results-input").click();
}

this.ensureRunnerClient([ ], { });
this.runnerClient.scoreCalculator = new ScoreCalculator(results);
this.showResults();
};
handleResultsFile(fileOrInput) {
const file = fileOrInput instanceof File ? fileOrInput : fileOrInput.files[0];
if (!file)
return;

reader.readAsText(file);
document.title = "File: " + reader.filename;
}, false);
const reader = new FileReader();
reader.filename = file.name;
reader.onload = (e) => {
const data = JSON.parse(e.target.result);
const results = (data['debugOutput'] instanceof Array) ?
RunData.resultsDataFromBenchmarkRunnerData(data['debugOutput']) :
RunData.resultsDataFromSingleRunData(data);
this.ensureRunnerClient([], {});
this.runnerClient.scoreCalculator = new ScoreCalculator(results);
this.showResults();
};
reader.readAsText(file);
document.title = "File: " + reader.filename;
}

frameRateDeterminationComplete(targetFrameRate)
{
let frameRateLabelContent = Strings.text.usingFrameRate.replace("%s", targetFrameRate);

if (!targetFrameRate) {
frameRateLabelContent = Strings.text.frameRateDetectionFailure;
targetFrameRate = 60;
Expand All @@ -635,7 +639,7 @@ class DebugBenchmarkController extends BenchmarkController {
startButton.disabled = true;
return;
}

startButton.disabled = (!suitesManager.isAtLeastOneTestSelected()) || !this.frameRateDetectionComplete;
}

Expand Down Expand Up @@ -708,6 +712,15 @@ class DebugBenchmarkController extends BenchmarkController {
const confidence = ((scoreCalculator.scoreLowerBound / score - 1) * 100).toFixed(2) +
"% / +" + ((scoreCalculator.scoreUpperBound / score - 1) * 100).toFixed(2) + "%";
const fps = scoreCalculator._systemFrameRate;

const resultsScoreProfileSelector = document.getElementById("results-score-profile");
if (resultsScoreProfileSelector)
resultsScoreProfileSelector.value = scoreCalculator.scoreProfile;

const graphScoreProfileSelector = document.getElementById("graph-score-profile");
if (graphScoreProfileSelector)
graphScoreProfileSelector.value = scoreCalculator.scoreProfile;

sectionsManager.setSectionVersion("results", scoreCalculator.version);
sectionsManager.setSectionScore("results", score.toFixed(2), confidence, fps);
sectionsManager.populateTable("results-header", Headers.testName, scoreCalculator);
Expand All @@ -720,10 +733,41 @@ class DebugBenchmarkController extends BenchmarkController {

showTestGraph(testName, testResult, testData)
{
this._currentGraphParams = {
testName: testName,
testResult: testResult,
testData: testData
};
sectionsManager.setSectionHeader("test-graph", testName);
sectionsManager.showSection("test-graph", true);
this.graphController.updateGraphData(testResult, testData, this.runnerClient.scoreCalculator.options);
}

reloadCurrentGraph() {
if (!this._currentGraphParams)
return;

const scoreCalculator = this.runnerClient.scoreCalculator;
const testData = this._currentGraphParams.testData;
const testName = this._currentGraphParams.testName;

// find the updated testResult from scoreCalculator
let updatedTestResult = null;
scoreCalculator.results.forEach(iteration => {
for (let suiteName in iteration[Strings.json.results.tests]) {
const suite = iteration[Strings.json.results.tests][suiteName];
if (suite[testName]) {
updatedTestResult = suite[testName];
return;
}
}
});

if (updatedTestResult) {
this._currentGraphParams.testResult = updatedTestResult;
this.showTestGraph(testName, updatedTestResult, testData);
}
}
}

window.benchmarkControllerClass = DebugBenchmarkController;
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
43 changes: 42 additions & 1 deletion MotionMark/resources/runner/motionmark.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ body {
cursor: default;

-webkit-user-select: none;
user-select: none;
}

body.showing-intro,
Expand Down Expand Up @@ -152,6 +153,7 @@ section .body p {
max-width: 60vw;

-webkit-user-select: text;
user-select: text;
cursor: text;
}

Expand Down Expand Up @@ -428,6 +430,7 @@ body.large .frame-container {

#results .body {
-webkit-user-select: text;
user-select: text;
}

#results .score-container {
Expand Down Expand Up @@ -460,6 +463,24 @@ body.large .frame-container {
padding-bottom: .3em;
}

#results .score-profile,
#test-graph .score-profile {
font-size: 0.8em;
margin-top: 0.5em;
margin-bottom: 1em;
}

#results .score-profile label,
#test-graph .score-profile label {
display: block;
}

#results .score-profile select,
#test-graph .score-profile select {
font-family: inherit;
font-size: inherit;
margin-left: 0.5em;
}
#results table {
border-spacing: 0;
margin: 0;
Expand Down Expand Up @@ -541,10 +562,23 @@ body.large .detail .large {
background: hsla(0, 0%, 100%, 0.9);
}

@supports (-webkit-backdrop-filter: blur(10px)) {
#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)) or (backdrop-filter: blur(10px)) {
#overlay {
background: hsla(0, 0%, 100%, 0.7);
-webkit-backdrop-filter: blur(20px);
backdrop-filter: blur(20px);
}
}

Expand All @@ -566,10 +600,17 @@ body.large .detail .large {

font-size: 12px;
-webkit-user-select: text;
user-select: text;
cursor: text;

max-height: 250px;

border: 1px solid hsla(0, 0%, 0%, 0.1);
padding: 1em;
}

#load-results-button {
margin-left: 1em;
min-width: auto;
font-size: 0.8em;
}
Loading