<table class="results-table"></table>
</data>
<footer>
- <button class="large-button" onclick="benchmarkController.showJson()">JSON</button>
+ <button class="large-button" onclick="benchmarkController.selectResults()">Select</button>
+ <button class="large-button" onclick="benchmarkController.showJSON()">JSON</button>
<button class="large-button" onclick="benchmarkController.startTest()">Test Again</button>
</footer>
</section>
<div class="results-json" contentEditable="true"></div>
</data>
<footer>
+ <button class="large-button" onclick="benchmarkController.selectJSON('json')">Select</button>
<button class="large-button" onclick="benchmarkController.showResults()">Results</button>
<button class="large-button" onclick="benchmarkController.startTest()">Test Again</button>
</footer>
<div class="results-json" contentEditable="true"></div>
</data>
<footer>
+ <button class="large-button" onclick="benchmarkController.selectJSON('test-json')">Select</button>
<button class="large-button" onclick="benchmarkController.showResults()">Results</button>
<button class="large-button" onclick="benchmarkController.startTest()">Test Again</button>
</footer>
{
return document.querySelector("#" + sectionIdentifier + " > header > h1");
},
+
+ _sectionDataElement: function(sectionIdentifier)
+ {
+ return document.querySelector("#" + sectionIdentifier + " > data");
+ },
_sectionDataDivElement: function(sectionIdentifier)
{
element.textContent = title + ":";
var score = benchmarkRunnerClient.score.toFixed(2);
- element.textContent += " [Score = " + score + "]";
+ element.textContent += " [" + Strings.text.score + " = " + score + "]";
},
showTestName: function(sectionIdentifier, title, testName)
if (!testName.length)
return;
- element.textContent += " [test = " + testName + "]";
+ element.textContent += " [" + Strings.text.testName + " = " + testName + "]";
},
showJSON: function(sectionIdentifier, json)
}, 4);
},
+ selectData: function(sectionIdentifier)
+ {
+ window.getSelection().removeAllRanges();
+ var element = this._sectionDataElement(sectionIdentifier);
+ var range = document.createRange();
+ range.selectNode(element);
+ window.getSelection().addRange(range);
+ },
+
+ selectDataContents: function(sectionIdentifier)
+ {
+ window.getSelection().removeAllRanges();
+ var element = this._sectionDataDivElement(sectionIdentifier);
+ var range = document.createRange();
+ range.selectNodeContents(element);
+ window.getSelection().addRange(range);
+ },
+
showSection: function(sectionIdentifier, pushState)
{
var currentSectionElement = document.querySelector("section.selected");
this._runBenchmark(suites, options);
sectionsManager.showSection("running");
},
+
+ selectResults: function()
+ {
+ sectionsManager.selectData("results");
+ },
showResults: function()
{
sectionsManager.showSection("results", true);
},
- showJson: function()
+ showJSON: function()
{
sectionsManager.showScore("json", Strings.text.results.results);
sectionsManager.showSection("json", true);
},
-
+
showTestGraph: function(testName, axes, samples, samplingTimeOffset)
{
sectionsManager.showTestName("test-graph", Strings.text.results.graph, testName);
sectionsManager.showTestName("test-json", Strings.text.results.graph, testName);
sectionsManager.showJSON("test-json", json);
sectionsManager.showSection("test-json", true);
- }
+ },
+
+ selectJSON: function(sectionIdentifier)
+ {
+ sectionsManager.selectDataContents(sectionIdentifier);
+ },
}
window.addEventListener("load", benchmarkController.initialize);
+2015-11-30 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ Add an option to select the results form the graphics benchmark
+ https://bugs.webkit.org/show_bug.cgi?id=151666
+
+ Reviewed by Ryosuke Niwa.
+
+ We need an easy way to select the graphics benchmark results table such
+ that when it is copied to the clipboard, rich text format is set to the
+ clipboard.
+
+ * Animometer/runner/animometer.html: Add a new button to select the results table or JSON.
+
+ * Animometer/runner/resources/animometer.js:
+ (window.sectionsManager._sectionDataElement): Selects the container <data> element.
+ (window.sectionsManager._sectionDataDivElement): Replace a literal string with a string table entry.
+ (window.sectionsManager.showTestName): Replace a literal string with a string table entry.
+ (window.sectionsManager.selectData): Selects the container <data> element in a selection.
+ (window.sectionsManager.selectDataContents): Select the contents of container <data> element in a selection.
+ (window.benchmarkController.selectResults): Selects the results table.
+ (window.benchmarkController.showJSON): Function rename.
+ (window.benchmarkController.selectJSON): Selects the contents of the results JSON.
+ (window.benchmarkController.showJson): Deleted.
+
2015-11-20 Simon Fraser <simon.fraser@apple.com>
Animometer: graphs should not do interpolation