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
7 changes: 6 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
48 changes: 26 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