[MotionMark] Update Multiply test
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2018 00:58:40 +0000 (00:58 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2018 00:58:40 +0000 (00:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188532
<rdar://problem/43252151>

Reviewed by Said Abou-Hallawa.

Update Multiply test to have a larger upper limit of number of particles. Cycle through three
different ways of hiding an element. Add new Multiple suite that isolates those components for
debugging purposes.

* MotionMark/resources/debug-runner/tests.js:
* MotionMark/tests/dom/multiply.html: Added.
* MotionMark/tests/dom/resources/multiply.js: Added.
* MotionMark/tests/master/resources/multiply.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234832 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/ChangeLog
PerformanceTests/MotionMark/resources/debug-runner/tests.js
PerformanceTests/MotionMark/tests/dom/multiply.html [new file with mode: 0644]
PerformanceTests/MotionMark/tests/dom/resources/multiply.js [new file with mode: 0644]
PerformanceTests/MotionMark/tests/master/resources/multiply.js

index c299a09..362bd7a 100644 (file)
@@ -1,5 +1,22 @@
 2018-08-13  Jon Lee  <jonlee@apple.com>
 
+        [MotionMark] Update Multiply test
+        https://bugs.webkit.org/show_bug.cgi?id=188532
+        <rdar://problem/43252151>
+
+        Reviewed by Said Abou-Hallawa.
+
+        Update Multiply test to have a larger upper limit of number of particles. Cycle through three
+        different ways of hiding an element. Add new Multiple suite that isolates those components for
+        debugging purposes.
+
+        * MotionMark/resources/debug-runner/tests.js:
+        * MotionMark/tests/dom/multiply.html: Added.
+        * MotionMark/tests/dom/resources/multiply.js: Added.
+        * MotionMark/tests/master/resources/multiply.js:
+
+2018-08-13  Jon Lee  <jonlee@apple.com>
+
         [MotionMark] Update Leaves test
         https://bugs.webkit.org/show_bug.cgi?id=188530
         <rdar://problem/43251862>
index 03b3626..7d701c9 100644 (file)
@@ -280,6 +280,23 @@ Suites.push(new Suite("Leaves suite",
     ]
 ));
 
+Suites.push(new Suite("Multiply suite",
+    [
+        {
+            url: "dom/multiply.html?style=opacity",
+            name: "Multiply: CSS opacity only"
+        },
+        {
+            url: "dom/multiply.html?style=display",
+            name: "Multiply: CSS display only"
+        },
+        {
+            url: "dom/multiply.html?style=visibility",
+            name: "Multiply: CSS visibility only"
+        }
+    ]
+));
+
 Suites.push(new Suite("Text suite",
     [
         {
diff --git a/PerformanceTests/MotionMark/tests/dom/multiply.html b/PerformanceTests/MotionMark/tests/dom/multiply.html
new file mode 100644 (file)
index 0000000..2a79689
--- /dev/null
@@ -0,0 +1,78 @@
+<!--
+  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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <link rel="stylesheet" type="text/css" href="../resources/stage.css">
+    <style type="text/css">
+
+    #stage {
+        background-color: #222;
+    }
+
+    #stage div {
+        position: absolute;
+    }
+
+    #stage .div-0 {
+        border-top-right-radius: 100%;
+    }
+
+    #stage .div-1 {
+        border-top-left-radius: 100%;
+    }
+
+    #stage .div-2 {
+        border-bottom-left-radius: 100%;
+    }
+
+    #stage .div-3 {
+        border-bottom-right-radius: 100%;
+    }
+
+    #stage .div-4 {
+        border-bottom-left-radius: 100%;
+        border-top-right-radius: 100%;
+    }
+
+    #stage .div-5 {
+        border-bottom-right-radius: 100%;
+        border-top-left-radius: 100%;
+    }
+    </style>
+</head>
+<body>
+    <div id="stage">
+    </div>
+    <script src="../../resources/strings.js"></script>
+    <script src="../../resources/extensions.js"></script>
+    <script src="../../resources/statistics.js"></script>
+    <script src="../resources/math.js"></script>
+    <script src="../resources/main.js"></script>
+    <script src="../master/resources/multiply.js"></script>
+    <script src="resources/multiply.js"></script>
+</body>
+</html>
diff --git a/PerformanceTests/MotionMark/tests/dom/resources/multiply.js b/PerformanceTests/MotionMark/tests/dom/resources/multiply.js
new file mode 100644 (file)
index 0000000..322a3b4
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+(function() {
+
+var MultiplyBenchmark = window.benchmarkClass;
+var MultiplyDerivedBenchmark = Utilities.createSubclass(MultiplyBenchmark,
+    function(options)
+    {
+        switch (options["style"]) {
+        case "opacity":
+            options.visibleCSS = [["opacity", 0, 1]];
+            break;
+        case "display":
+            options.visibleCSS = [["display", "none", "block"]];
+            break;
+        case "visibility":
+            options.visibleCSS = [["visibility", "hidden", "visible"]];
+            break;
+        }
+        MultiplyBenchmark.call(this, options);
+    }
+);
+
+window.benchmarkClass = MultiplyDerivedBenchmark;
+
+})();
\ No newline at end of file
index 54d6a45..e58eaa3 100644 (file)
@@ -32,10 +32,19 @@ var MultiplyStage = Utilities.createSubclass(Stage,
         this._offsetIndex = 0;
     }, {
 
+    visibleCSS: [
+        ["visibility", "hidden", "visible"],
+        ["opacity", 0, 1],
+        ["display", "none", "block"]
+    ],
+    totalRows: 45,
+
     initialize: function(benchmark, options)
     {
         Stage.prototype.initialize.call(this, benchmark, options);
-        var tileSize = Math.round(this.size.height / 25);
+        var tileSize = Math.round(this.size.height / this.totalRows);
+        if (options.visibleCSS)
+            this.visibleCSS = options.visibleCSS;
 
         // Fill the scene with elements
         var x = Math.round((this.size.width - tileSize) / 2);
@@ -83,7 +92,8 @@ var MultiplyStage = Utilities.createSubclass(Stage,
         tile.style.top = y + 'px';
         tile.style.width = tileSize + 'px';
         tile.style.height = tileSize + 'px';
-        tile.style.visibility = "hidden";
+        var visibleCSS = this.visibleCSS[this.tiles.length % this.visibleCSS.length];
+        tile.style[visibleCSS[0]] = visibleCSS[1];
 
         var distance = 1 / tileSize * this.size.multiply(0.5).subtract(new Point(x + halfTileSize, y + halfTileSize)).length();
         this.tiles.push({
@@ -91,7 +101,8 @@ var MultiplyStage = Utilities.createSubclass(Stage,
             rotate: rotateDeg,
             step: Math.max(3, distance / 1.5),
             distance: distance,
-            active: false
+            active: false,
+            visibleCSS: visibleCSS,
         });
     },
 
@@ -116,7 +127,7 @@ var MultiplyStage = Utilities.createSubclass(Stage,
         for (var i = 0; i < this._offsetIndex; ++i) {
             var tile = this.tiles[i];
             tile.active = true;
-            tile.element.style.visibility = "";
+            tile.element.style[tile.visibleCSS[0]] = tile.visibleCSS[2];
             tile.rotate += tile.step;
             tile.element.style.transform = "rotate(" + tile.rotate + "deg)";
 
@@ -125,8 +136,9 @@ var MultiplyStage = Utilities.createSubclass(Stage,
         }
 
         for (var i = this._offsetIndex; i < this.tiles.length && this.tiles[i].active; ++i) {
-            this.tiles[i].active = false;
-            this.tiles[i].element.style.visibility = "hidden";
+            var tile = this.tiles[i];
+            tile.active = false;
+            tile.element.style[tile.visibleCSS[0]] = tile.visibleCSS[1];
         }
     }
 });