WebKit Bugzilla
Attachment 342438 Details for
Bug 186479
: [MotionMark] Add support for version numbers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186479-20180611094320.patch (text/plain), 20.10 KB, created by
Jon Lee
on 2018-06-11 09:43:21 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jon Lee
Created:
2018-06-11 09:43:21 PDT
Size:
20.10 KB
patch
obsolete
>Subversion Revision: 232658 >diff --git a/PerformanceTests/ChangeLog b/PerformanceTests/ChangeLog >index 3524c351547fbdf51462a94d1adb7713b5ece201..bec43ada7f17bdeb432fba6cd40fc4cd1d0fdf36 100644 >--- a/PerformanceTests/ChangeLog >+++ b/PerformanceTests/ChangeLog >@@ -1,3 +1,59 @@ >+2018-06-10 Jon Lee <jonlee@apple.com> >+ >+ [MotionMark] Add support for version numbers >+ https://bugs.webkit.org/show_bug.cgi?id=186479 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add support for displaying the version number as well as including it in the JSON results. >+ >+ When loading the front page, script replaces any element with classname version with the >+ version number of the benchmark, which is stored in Strings.version. >+ >+ The JSON structure for the results includes a new version property: >+ { >+ "version": "1.0", >+ "options": { ... }, >+ "data": [ ... ] >+ } >+ >+ When dragging a results file, the version listed will come from the JSON file. Older >+ results will not have had the version property, in which case it will default to "1.0". >+ >+ * MotionMark/index.html: Update title to some other default. Script will update it. >+ Include the version number in the logo title. >+ * MotionMark/developer.html: Ditto. >+ * MotionMark/about.html: Ditto. >+ >+ * MotionMark/resources/runner/motionmark.js: >+ (ResultsDashboard): Update constructor to include version. This is used when serializing >+ results out to JSON, and displaying the results panel in developer mode. >+ (ResultsDashboard._processData): When running the benchmark, include benchmark version string >+ in the results object. >+ (ResultsDashboard.version): >+ (window.benchmarkRunnerClient.willStartFirstIteration): When running the benchmark, pass the >+ benchmark version string to the dashboard, which holds the results. >+ (window.sectionsManager.setSectionVersion): Helper function to update the element in the >+ section with the class name version. >+ (window.benchmarkController.initialize): Populate all DOM elements with class name "version" >+ with the version string. Update the page title. >+ (window.benchmarkController.showResults): When showing results, update the version string >+ based on what is included in the JSON results, which would be the same as the benchmark version. >+ * MotionMark/resources/runner/motionmark.css: Include missing copyright. Wrap the SVG logo >+ in a div and include the version string. >+ * MotionMark/resources/strings.js: Add strings for the page title template, and the version. >+ >+ * MotionMark/resources/debug-runner/motionmark.css: >+ * MotionMark/resources/debug-runner/motionmark.js: >+ (window.benchmarkRunnerClient.willStartFirstIteration): When running the benchmark, pass the >+ benchmark version string to the dashboard, which holds the results. >+ (window.benchmarkController.initialize): Populate all DOM elements with class name "version" >+ with the version string. Update the page title. When dragging in JSON results, look for >+ version to pass to the dashboard. If it doesn't exist, default to "1.0". >+ (window.benchmarkController.showResults): When showing results, update the version string >+ based on what is included in the JSON results, instead of the current benchmark version. >+ * MotionMark/resources/debug-runner/tests.js: Update page title template. >+ > 2018-06-08 Jon Lee <jonlee@apple.com> > > [MotionMark] Rename Suits test files >diff --git a/PerformanceTests/MotionMark/about.html b/PerformanceTests/MotionMark/about.html >index 20a82c857fc2a10a1b1bd80df9fed4fa46d441f1..6a41c873065d5c31efa5877b91a73ef2e5c56a41 100644 >--- a/PerformanceTests/MotionMark/about.html >+++ b/PerformanceTests/MotionMark/about.html >@@ -1,5 +1,5 @@ > <!-- >- Copyright (C) 2015-2017 Apple Inc. All rights reserved. >+ Copyright (C) 2015-2018 Apple Inc. All rights reserved. > > Redistribution and use in source and binary forms, with or without > modification, are permitted provided that the following conditions >@@ -31,14 +31,16 @@ > <title>About MotionMark</title> > > <link rel="stylesheet" href="resources/runner/motionmark.css"> >+ >+ <script src="resources/strings.js"></script> > </head> > <body class="images-loaded"> > <main> > <section id="about" class="selected"> >- <svg class="logo"><use xlink:href="resources/runner/logo.svg#root"></svg> >+ <div class="logo"><svg><use xlink:href="resources/runner/logo.svg#root" /></svg></div> > > <div class="body"> >- <h1>About MotionMark</h1> >+ <h1>About MotionMark <span class="version"></span></h1> > > <p>MotionMark is a web benchmark that focuses on graphics performance. It draws multiple rendering elements, each of which uses the same set of graphics primitives. An element could be an SVG node, an HTML element with CSS style, or a series of canvas operations. Slight variations among the elements avoid trivial caching optimizations by the browser. Although fairly simple, the effects were chosen to reflect techniques commonly used on the web. Tests are visually rich, being designed to stress the graphics system rather than JavaScript.</p> > >@@ -72,5 +74,10 @@ > </div> > </section> > </main> >+ >+ <script> >+ document.title = "About MotionMark " + Strings.version; >+ document.querySelector(".version").textContent = Strings.version; >+ </script> > </body> > </html> >\ No newline at end of file >diff --git a/PerformanceTests/MotionMark/developer.html b/PerformanceTests/MotionMark/developer.html >index 29b91446893fa85bbea262a5325d2f588bf4e333..f1b21479ebf89816806c6415e39c479e92816238 100644 >--- a/PerformanceTests/MotionMark/developer.html >+++ b/PerformanceTests/MotionMark/developer.html >@@ -28,7 +28,7 @@ > <meta charset="utf-8"> > <meta name="viewport" content="width=device-width, user-scalable=no"> > >- <title>MotionMark 1.0 - developer</title> >+ <title>MotionMark developer</title> > > <link rel="stylesheet" href="resources/runner/motionmark.css"> > <link rel="stylesheet" href="resources/debug-runner/motionmark.css"> >@@ -49,7 +49,10 @@ > <body class="showing-intro"> > <main> > <section id="intro" class="selected"> >- <h1>MotionMark</h1> >+ <header> >+ <h1>MotionMark</h1> >+ <h2>version <span class="version"></span></h2> >+ </header> > <div class="body"> > <div> > <div id="suites"> >@@ -131,6 +134,7 @@ > <span class="medium">on a medium screen (laptop, tablet)</span> > <span class="large">on a large screen (desktop)</span> > </div> >+ <div>version <span class="version"></span></div> > <p class="score" onclick="benchmarkController.showDebugInfo()"></p> > <p class="confidence"></p> > <div id="results-tables" class="table-container"> >diff --git a/PerformanceTests/MotionMark/index.html b/PerformanceTests/MotionMark/index.html >index e210d0cdd0eef58a4942d6b5ab692765b68819e9..876e0de61af8dd1e0070f5df07dc2ed724e56036 100644 >--- a/PerformanceTests/MotionMark/index.html >+++ b/PerformanceTests/MotionMark/index.html >@@ -1,5 +1,5 @@ > <!-- >- Copyright (C) 2015-2017 Apple Inc. All rights reserved. >+ Copyright (C) 2015-2018 Apple Inc. All rights reserved. > > Redistribution and use in source and binary forms, with or without > modification, are permitted provided that the following conditions >@@ -28,7 +28,7 @@ > <meta charset="utf-8"> > <meta name="viewport" content="width=device-width, user-scalable=no"> > >- <title>MotionMark 1.0</title> >+ <title>MotionMark</title> > > <link rel="stylesheet" href="resources/runner/motionmark.css"> > >@@ -51,7 +51,10 @@ > <body class="showing-intro"> > <main> > <section id="intro" class="selected"> >- <svg class="logo"><use xlink:href="resources/runner/logo.svg#root"></svg> >+ <div class="logo"> >+ <svg><use xlink:href="resources/runner/logo.svg#root" /></svg> >+ <div>version <span class="version"></span></div> >+ </div> > <div class="body"> > <p>MotionMark is a graphics benchmark that measures a browserâs capability to animate complex scenes at a target frame rate.</p> > >@@ -65,7 +68,10 @@ > <section id="test-container" class="frame-container"></section> > > <section id="results"> >- <svg class="logo"><use xlink:href="resources/runner/logo.svg#root"></svg> >+ <div class="logo"> >+ <svg><use xlink:href="resources/runner/logo.svg#root" /></svg> >+ <div>version <span class="version"></span></div> >+ </div> > <div class="body"> > <div class="score-container"> > <div class="score"></div> >diff --git a/PerformanceTests/MotionMark/resources/debug-runner/motionmark.css b/PerformanceTests/MotionMark/resources/debug-runner/motionmark.css >index ad196dbf99e06ddaddf6c0a7508cf88842044093..6aee45b3696c436b5c3724da2d525c52f263e7cf 100644 >--- a/PerformanceTests/MotionMark/resources/debug-runner/motionmark.css >+++ b/PerformanceTests/MotionMark/resources/debug-runner/motionmark.css >@@ -45,12 +45,16 @@ section .body { > transform: none; > } > >-h1 { >- font-size: 3em; >- margin: 1.5em 0 .5em; >+header { >+ margin: 3em 0 1em; > text-align: center; > } > >+header h1, header h2 { >+ font-size: 3em; >+ margin: 0; >+} >+ > button { > transform: none !important; > min-width: initial; >@@ -84,8 +88,8 @@ button:disabled { > > @media screen and (max-device-width: 414px), > screen and (max-device-height: 414px) and (orientation: landscape) { >- h1 { >- font-size: 2.5em; >+ header h1 { >+ font-size: 2em; > } > > section { >diff --git a/PerformanceTests/MotionMark/resources/debug-runner/motionmark.js b/PerformanceTests/MotionMark/resources/debug-runner/motionmark.js >index ffc7a7dbcf12cf38bf177d5d7d3fdb731ad93f0e..76cd9d722cba858e08a00ec6a26332a1bba832bd 100644 >--- a/PerformanceTests/MotionMark/resources/debug-runner/motionmark.js >+++ b/PerformanceTests/MotionMark/resources/debug-runner/motionmark.js >@@ -134,7 +134,7 @@ Utilities.extendObject(window.benchmarkRunnerClient, { > > willStartFirstIteration: function() > { >- this.results = new ResultsDashboard(this.options); >+ this.results = new ResultsDashboard(Strings.version, this.options); > this.progressBar = new ProgressBar(document.getElementById("progress-completed"), this.testsCount); > }, > >@@ -532,6 +532,11 @@ window.suitesManager = > Utilities.extendObject(window.benchmarkController, { > initialize: function() > { >+ document.title = Strings.text.title.replace("%s", Strings.version); >+ document.querySelectorAll(".version").forEach(function(e) { >+ e.textContent = Strings.version; >+ }); >+ > document.forms["benchmark-options"].addEventListener("change", benchmarkController.onBenchmarkOptionsChanged, true); > document.forms["graph-type"].addEventListener("change", benchmarkController.onGraphTypeChanged, true); > document.forms["time-graph-options"].addEventListener("change", benchmarkController.onTimeGraphOptionsChanged, true); >@@ -571,7 +576,9 @@ Utilities.extendObject(window.benchmarkController, { > var run = JSON.parse(e.target.result); > if (run.debugOutput instanceof Array) > run = run.debugOutput[0]; >- benchmarkRunnerClient.results = new ResultsDashboard(run.options, run.data); >+ if (!("version" in run)) >+ run.version = "1.0"; >+ benchmarkRunnerClient.results = new ResultsDashboard(run.version, run.options, run.data); > benchmarkController.showResults(); > }; > >@@ -657,6 +664,7 @@ Utilities.extendObject(window.benchmarkController, { > var score = dashboard.score; > var confidence = ((dashboard.scoreLowerBound / score - 1) * 100).toFixed(2) + > "% / +" + ((dashboard.scoreUpperBound / score - 1) * 100).toFixed(2) + "%"; >+ sectionsManager.setSectionVersion("results", dashboard.version); > sectionsManager.setSectionScore("results", score.toFixed(2), confidence); > sectionsManager.populateTable("results-header", Headers.testName, dashboard); > sectionsManager.populateTable("results-score", Headers.score, dashboard); >diff --git a/PerformanceTests/MotionMark/resources/debug-runner/tests.js b/PerformanceTests/MotionMark/resources/debug-runner/tests.js >index c76175fde7f1c92cb4689dc7599d7cd04cf8ff81..f17831418f83fcb21dc763df194814df08d77ca2 100644 >--- a/PerformanceTests/MotionMark/resources/debug-runner/tests.js >+++ b/PerformanceTests/MotionMark/resources/debug-runner/tests.js >@@ -28,7 +28,8 @@ Utilities.extendObject(Strings.text, { > frameRate: "FPS", > confidenceInterval: "80% Confidence Interval", > mergedRawComplexity: "Raw Complexity", >- graph: "Graph" >+ graph: "Graph", >+ title: "MotionMark %s developer", > }); > > >diff --git a/PerformanceTests/MotionMark/resources/runner/motionmark.css b/PerformanceTests/MotionMark/resources/runner/motionmark.css >index 86da6bea1c37862b42f69be4d793d72f8c559c3d..e370f4db513378ee31bb6562c7c05d9d0c6d69cf 100644 >--- a/PerformanceTests/MotionMark/resources/runner/motionmark.css >+++ b/PerformanceTests/MotionMark/resources/runner/motionmark.css >@@ -1,5 +1,28 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ > /* Outer harness */ >- > html, > body { > min-height: 100%; >@@ -72,14 +95,16 @@ section.selected { > display: block; > } > >-svg.logo { >+.logo { >+ position: relative; >+} >+ >+.logo svg { > width: 350px; > height: 88px; > > max-width: 100%; > >- padding-bottom: 1em; >- > color: hsl(35, 100%, 50%); > > animation: foreground-color 60s linear infinite 2s; >@@ -88,19 +113,32 @@ svg.logo { > will-change: color; > } > >-body.images-loaded svg.logo { >+.logo div { >+ transform: skewX(-10deg); >+ margin-left: 1em; >+} >+ >+body.images-loaded .logo svg { > animation-play-state: running; > } > > @media screen and (min-width: 667px) { >- svg.logo { >+ .logo svg { > width: 525px; > height: 130px; >+ padding-left: .4em; >+ } >+ >+ .logo div { >+ position: absolute; >+ left: 360px; >+ bottom: 0.2em; >+ font-size: 75%; > } > } > > section .body { >- margin: 0 1em; >+ margin: 2em 1em 0; > max-width: 350px; > } > >diff --git a/PerformanceTests/MotionMark/resources/runner/motionmark.js b/PerformanceTests/MotionMark/resources/runner/motionmark.js >index 1d16d8fbabfd34ca11f1cb36c88cbb850c8e4722..d45155e6d108b275ee3f220ac3cb801187d9e033 100644 >--- a/PerformanceTests/MotionMark/resources/runner/motionmark.js >+++ b/PerformanceTests/MotionMark/resources/runner/motionmark.js >@@ -23,11 +23,12 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > ResultsDashboard = Utilities.createClass( >- function(options, testData) >+ function(version, options, testData) > { > this._iterationsSamplers = []; > this._options = options; > this._results = null; >+ this._version = version; > if (testData) { > this._iterationsSamplers = testData; > this._processData(); >@@ -81,6 +82,7 @@ > iterationsScores.push(result[Strings.json.score]); > }, this); > >+ this._results[Strings.json.version] = this._version; > this._results[Strings.json.score] = Statistics.sampleMean(iterationsScores.length, iterationsScores.reduce(function(a, b) { return a + b; })); > this._results[Strings.json.scoreLowerBound] = this._results[Strings.json.results.iterations][0][Strings.json.scoreLowerBound]; > this._results[Strings.json.scoreUpperBound] = this._results[Strings.json.results.iterations][0][Strings.json.scoreUpperBound]; >@@ -250,6 +252,11 @@ > return this._options; > }, > >+ get version() >+ { >+ return this._version; >+ }, >+ > _getResultsProperty: function(property) > { > if (this._results) >@@ -388,7 +395,7 @@ window.benchmarkRunnerClient = { > > willStartFirstIteration: function() > { >- this.results = new ResultsDashboard(this.options); >+ this.results = new ResultsDashboard(Strings.version, this.options); > }, > > didRunSuites: function(suitesSamplers) >@@ -430,6 +437,11 @@ window.sectionsManager = > history.pushState({section: sectionIdentifier}, document.title); > }, > >+ setSectionVersion: function(sectionIdentifier, version) >+ { >+ document.querySelector("#" + sectionIdentifier + " .version").textContent = version; >+ }, >+ > setSectionScore: function(sectionIdentifier, score, confidence) > { > document.querySelector("#" + sectionIdentifier + " .score").textContent = score; >@@ -447,6 +459,10 @@ window.sectionsManager = > window.benchmarkController = { > initialize: function() > { >+ document.title = Strings.text.title.replace("%s", Strings.version); >+ document.querySelectorAll(".version").forEach(function(e) { >+ e.textContent = Strings.version; >+ }); > benchmarkController.addOrientationListenerIfNecessary(); > }, > >@@ -536,6 +552,7 @@ window.benchmarkController = { > var dashboard = benchmarkRunnerClient.results; > var score = dashboard.score; > var confidence = "±" + (Statistics.largestDeviationPercentage(dashboard.scoreLowerBound, score, dashboard.scoreUpperBound) * 100).toFixed(2) + "%"; >+ sectionsManager.setSectionVersion("results", dashboard.version); > sectionsManager.setSectionScore("results", score.toFixed(2), confidence); > sectionsManager.populateTable("results-header", Headers.testName, dashboard); > sectionsManager.populateTable("results-score", Headers.score, dashboard); >@@ -584,6 +601,7 @@ window.benchmarkController = { > data.textContent = "Please wait..."; > setTimeout(function() { > var output = { >+ version: benchmarkRunnerClient.results.version, > options: benchmarkRunnerClient.results.options, > data: benchmarkRunnerClient.results.data > }; >diff --git a/PerformanceTests/MotionMark/resources/strings.js b/PerformanceTests/MotionMark/resources/strings.js >index 55a47e7b95e4729887306192c75bcf8fc6997d24..a59e1011c5e7c62257cc38cfb1383bdc0c259c82 100644 >--- a/PerformanceTests/MotionMark/resources/strings.js >+++ b/PerformanceTests/MotionMark/resources/strings.js >@@ -23,11 +23,15 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > var Strings = { >+ version: "1.0", > text: { > testName: "Test Name", >- score: "Score" >+ score: "Score", >+ title: "MotionMark %s", > }, > json: { >+ version: "version", >+ > marks: "marks", > samplingStartTimeOffset: "Start sampling", > samplingEndTimeOffset: "End sampling",
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186479
: 342438 |
342529