Add isolated text tests for MotionMark
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Nov 2017 06:54:44 +0000 (06:54 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Nov 2017 06:54:44 +0000 (06:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=179226

Reviewed by Darin Adler.

Add a private suite that simplifies the design test.

* MotionMark/resources/debug-runner/tests.js:
* MotionMark/resources/runner/tests.js:
* MotionMark/tests/master/design.html: Copied from PerformanceTests/MotionMark/tests/master/text.html.
Rename the html file to the title of the test.
* MotionMark/tests/master/resources/design.js: Renamed from PerformanceTests/MotionMark/tests/master/resources/text.js.
* MotionMark/tests/text/design-6.html: Copied from PerformanceTests/MotionMark/tests/master/text.html.
Six active cells
* MotionMark/tests/text/design-6.js: Added.
* MotionMark/tests/text/design.html: Renamed from PerformanceTests/MotionMark/tests/master/text.html.
Replace the text with empty table cells that are populated with desired text.
* MotionMark/tests/text/design.js: Added.

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

PerformanceTests/ChangeLog
PerformanceTests/MotionMark/resources/debug-runner/tests.js
PerformanceTests/MotionMark/resources/runner/tests.js
PerformanceTests/MotionMark/tests/master/design.html [moved from PerformanceTests/MotionMark/tests/master/text.html with 98% similarity]
PerformanceTests/MotionMark/tests/master/resources/design.js [moved from PerformanceTests/MotionMark/tests/master/resources/text.js with 100% similarity]
PerformanceTests/MotionMark/tests/text/design-6.html [new file with mode: 0644]
PerformanceTests/MotionMark/tests/text/design-6.js [new file with mode: 0644]
PerformanceTests/MotionMark/tests/text/design.html [new file with mode: 0644]
PerformanceTests/MotionMark/tests/text/design.js [new file with mode: 0644]

index 7862c7b..5646226 100644 (file)
@@ -1,3 +1,24 @@
+2017-11-12  Jon Lee  <jonlee@apple.com>
+
+        Add isolated text tests for MotionMark
+        https://bugs.webkit.org/show_bug.cgi?id=179226
+
+        Reviewed by Darin Adler.
+
+        Add a private suite that simplifies the design test.
+
+        * MotionMark/resources/debug-runner/tests.js:
+        * MotionMark/resources/runner/tests.js:
+        * MotionMark/tests/master/design.html: Copied from PerformanceTests/MotionMark/tests/master/text.html.
+        Rename the html file to the title of the test.
+        * MotionMark/tests/master/resources/design.js: Renamed from PerformanceTests/MotionMark/tests/master/resources/text.js.
+        * MotionMark/tests/text/design-6.html: Copied from PerformanceTests/MotionMark/tests/master/text.html.
+        Six active cells
+        * MotionMark/tests/text/design-6.js: Added.
+        * MotionMark/tests/text/design.html: Renamed from PerformanceTests/MotionMark/tests/master/text.html.
+        Replace the text with empty table cells that are populated with desired text.
+        * MotionMark/tests/text/design.js: Added.
+
 2017-11-06  Robin Morisset  <rmorisset@apple.com>
 
         Add a third benchmark to TailBench
index 075b7de..d770400 100644 (file)
@@ -266,6 +266,35 @@ Suites.push(new Suite("SVG suite",
     ]
 ));
 
+Suites.push(new Suite("Text suite",
+    [
+        {
+            url: "text/design.html?corpus=latin",
+            name: "Design: Latin only (12 items)"
+        },
+        {
+            url: "text/design.html?corpus=cjk",
+            name: "Design: CJK only (12 items)"
+        },
+        {
+            url: "text/design.html?corpus=arabic",
+            name: "Design: RTL and complex scripts only (12 items)"
+        },
+        {
+            url: "text/design-6.html?corpus=latin",
+            name: "Design: Latin only (6 items)"
+        },
+        {
+            url: "text/design-6.html?corpus=cjk",
+            name: "Design: CJK only (6 items)"
+        },
+        {
+            url: "text/design-6.html?corpus=arabic",
+            name: "Design: RTL and complex scripts only (6 items)"
+        },
+    ]
+));
+
 Suites.push(new Suite("3D Graphics",
     [
         {
index 6b6be88..1ab7211 100644 (file)
@@ -60,7 +60,7 @@ Suites.push(new Suite("MotionMark",
             name: "Images"
         },
         {
-            url: "master/text.html",
+            url: "master/design.html",
             name: "Design"
         },
         {
     <script src="../../resources/statistics.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
-    <script src="resources/text.js"></script>
+    <script src="resources/design.js"></script>
 </body>
 </html>
diff --git a/PerformanceTests/MotionMark/tests/text/design-6.html b/PerformanceTests/MotionMark/tests/text/design-6.html
new file mode 100644 (file)
index 0000000..8bda8dc
--- /dev/null
@@ -0,0 +1,117 @@
+<!--
+  Copyright (C) 2017 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 {
+            font-family: Helvetica;
+            font-size: 52px;
+            background-color: #422E2C;
+        }
+        @media (max-width: 900px) {
+            #stage {
+                font-size: 40px;
+            }
+        }
+        @media (max-width: 568px) {
+            #stage {
+                font-size: 28px;
+            }
+        }
+
+        #stage div {
+            width: 80%;
+            height: 90%;
+            position: absolute;
+            text-align: center;
+        }
+        #template {
+            color: #FCFCFC;
+        }
+        table {
+            position: relative;
+            width: 100%;
+            height: 100%;
+        }
+        td {
+            width: 25%;
+        }
+        tr {
+            height: 20%;
+        }
+    </style>
+</head>
+<body>
+    <div id="stage">
+        <div id="template">
+            <table>
+                <tbody>
+                    <tr>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td></td>
+                        <td id="cell0"></td>
+                        <td id="cell1"></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td></td>
+                        <td id="cell2"></td>
+                        <td id="cell3"></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td></td>
+                        <td id="cell4"></td>
+                        <td id="cell5"></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
+    </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/design.js"></script>
+    <script src="design-6.js" charset="utf-8"></script>
+</body>
+</html>
diff --git a/PerformanceTests/MotionMark/tests/text/design-6.js b/PerformanceTests/MotionMark/tests/text/design-6.js
new file mode 100644 (file)
index 0000000..9401657
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2017 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() {
+
+// The MotionMark-based TextBenchmark should already be set to |window.benchmarkClass|
+var TextBenchmark = window.benchmarkClass;
+var TextTemplateBenchmark = Utilities.createSubclass(TextBenchmark,
+    function(options)
+    {
+        var dataset;
+        switch (options["corpus"]) {
+        case "latin":
+            dataset = [
+                "σχέδιο",
+                "umění",
+                "design",
+                "искусство",
+                "conception",
+                "diseño"
+            ];
+            break;
+        case "cjk":
+            dataset = [
+                "设计",
+                "디자인",
+                "デザイン",
+                "예술",
+                "使吃惊",
+                "がいねん",
+            ];
+            break;
+        case "arabic":
+            dataset = [
+                {text: "تصميم", direction: "rtl"},
+                "வடிவமைப்பு",
+                "योजना",
+                {text: "לְעַצֵב", direction: "rtl"},
+                {text: "خلاق", direction: "rtl"},
+                "ศิลปะ",
+            ];
+            break;
+        }
+
+        dataset.forEach(function(entry, i) {
+            var td = document.getElementById("cell" + i);
+            if (typeof entry === 'string') {
+                td.innerText = entry;
+            } else {
+                td.innerText = entry.text;
+                td.classList.add("rtl");
+            }
+        })
+
+        TextBenchmark.call(this, options);
+    }
+);
+
+window.benchmarkClass = TextTemplateBenchmark;
+
+})();
\ No newline at end of file
diff --git a/PerformanceTests/MotionMark/tests/text/design.html b/PerformanceTests/MotionMark/tests/text/design.html
new file mode 100644 (file)
index 0000000..bd1428c
--- /dev/null
@@ -0,0 +1,107 @@
+<!--
+  Copyright (C) 2017 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 {
+            font-family: Helvetica;
+            font-size: 52px;
+            background-color: #422E2C;
+        }
+        @media (max-width: 900px) {
+            #stage {
+                font-size: 40px;
+            }
+        }
+        @media (max-width: 568px) {
+            #stage {
+                font-size: 28px;
+            }
+        }
+
+        #stage div {
+            width: 80%;
+            height: 90%;
+            position: absolute;
+            text-align: center;
+        }
+        #template {
+            color: #FCFCFC;
+        }
+        table {
+            position: relative;
+            width: 100%;
+            height: 100%;
+        }
+        td {
+            width: 33%;
+        }
+        tr {
+            height: 20%;
+        }
+    </style>
+</head>
+<body>
+    <div id="stage">
+        <div id="template">
+            <table>
+                <tbody>
+                    <tr>
+                        <td id="cell0"></td>
+                        <td id="cell1"></td>
+                        <td id="cell2"></td>
+                    </tr>
+                    <tr>
+                        <td id="cell3"></td>
+                        <td id="cell4"></td>
+                        <td id="cell5"></td>
+                    </tr>
+                    <tr>
+                        <td id="cell6"></td>
+                        <td id="cell7"></td>
+                        <td id="cell8"></td>
+                    </tr>
+                    <tr>
+                        <td id="cell9"></td>
+                        <td id="cell10"></td>
+                        <td id="cell11"></td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
+    </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/design.js"></script>
+    <script src="design.js" charset="utf-8"></script>
+</body>
+</html>
diff --git a/PerformanceTests/MotionMark/tests/text/design.js b/PerformanceTests/MotionMark/tests/text/design.js
new file mode 100644 (file)
index 0000000..9ec8a80
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2017 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() {
+
+// The MotionMark-based TextBenchmark should already be set to |window.benchmarkClass|
+var TextBenchmark = window.benchmarkClass;
+var TextTemplateBenchmark = Utilities.createSubclass(TextBenchmark,
+    function(options)
+    {
+        var dataset;
+        switch (options["corpus"]) {
+        case "latin":
+            dataset = [
+                "σχέδιο",
+                "umění",
+                "suunnittelu",
+                "design",
+                "deseń",
+                "искусство",
+                "дизайн",
+                "conception",
+                "kunst",
+                "konstruktion",
+                "τέχνη",
+                "diseño"
+            ];
+            break;
+        case "cjk":
+            dataset = [
+                "设计",
+                "디자인",
+                "デザイン",
+                "がいねん",
+                "藝術",
+                "养殖",
+                "예술",
+                "展開する",
+                "발달",
+                "技術",
+                "驚き",
+                "使吃惊",
+            ];
+            break;
+        case "arabic":
+            dataset = [
+                {text: "تصميم", direction: "rtl"},
+                "வடிவமைப்பு",
+                "योजना",
+                {text: "לְעַצֵב", direction: "rtl"},
+                {text: "خلاق", direction: "rtl"},
+                "ศิลปะ",
+                "कौशल",
+                {text: "אָמָנוּת", direction: "rtl"},
+                "கலை",
+                "ดีไซน์",
+                "পরিকল্পনা",
+                {text: "ډیزاین", direction: "rtl"},
+            ];
+            break;
+        }
+
+        dataset.forEach(function(entry, i) {
+            var td = document.getElementById("cell" + i);
+            if (typeof entry === 'string') {
+                td.innerText = entry;
+            } else {
+                td.innerText = entry.text;
+                td.classList.add("rtl");
+            }
+        })
+
+        TextBenchmark.call(this, options);
+    }
+);
+
+window.benchmarkClass = TextTemplateBenchmark;
+
+})();
\ No newline at end of file