summaryrefslogtreecommitdiffstats
path: root/third_party/webkit/PerformanceTests/StyleBench/mozilla.patch
blob: 2c3988f2ff8b7a2ef91ac3c0e8bc6234e23ea622 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
diff --git a/third_party/webkit/PerformanceTests/StyleBench/resources/benchmark-report.js b/third_party/webkit/PerformanceTests/StyleBench/resources/benchmark-report.js
index b33021d9d9ce..58b3e46982d1 100644
--- a/third_party/webkit/PerformanceTests/StyleBench/resources/benchmark-report.js
+++ b/third_party/webkit/PerformanceTests/StyleBench/resources/benchmark-report.js
@@ -1,12 +1,13 @@
 // This file can be customized to report results as needed.
 
 (function () {
-    if (!window.testRunner && location.search != '?webkit' && location.hash != '#webkit')
+    if (!window.testRunner && location.search != '?webkit' && location.hash != '#webkit' &&
+        location.search != '?gecko' && location.search != '?raptor')
         return;
 
     if (window.testRunner)
         testRunner.waitUntilDone();
 
     var scriptElement = document.createElement('script');
     scriptElement.src = '../resources/runner.js';
     document.head.appendChild(scriptElement);
@@ -31,20 +32,22 @@
                     customIterationCount: iterationCount,
                     doNotIgnoreInitialRun: true,
                     doNotMeasureMemoryUsage: true,
                     continueTesting: !isLastTest,
                     unit: unit,
                     name: name,
                     aggregator: aggregator};
             }
-            PerfTestRunner.prepareToMeasureValuesAsync(createTest(null, 'Geometric'));
+            if (window.PerfTestRunner)
+                PerfTestRunner.prepareToMeasureValuesAsync(createTest(null, 'Geometric'));
         },
         didRunSuites: function (measuredValues) {
-            PerfTestRunner.measureValueAsync(measuredValues.geomean);
+            if (window.PerfTestRunner)
+                PerfTestRunner.measureValueAsync(measuredValues.geomean);
             valuesByIteration.push(measuredValues);
         },
         didFinishLastIteration: function () {
             document.head.removeChild(document.querySelector('style'));
 
             var measuredValuesByFullName = {};
             function addToMeasuredValue(value, fullName, aggregator) {
                 var values = measuredValuesByFullName[fullName] || new Array;
@@ -63,21 +66,37 @@
                         for (var subtestName in test.tests)
                             addToMeasuredValue(test.tests[subtestName], suiteName + '/' + testName + '/' + subtestName);
                         addToMeasuredValue(test.total, suiteName + '/' + testName, 'Total');
                     }
                     addToMeasuredValue(suite.total, suiteName, 'Total');
                 }
             });
 
-            PerfTestRunner.reportValues(createTest(null, null, false, 'pt'), scores);
+            if (window.PerfTestRunner)
+                PerfTestRunner.reportValues(createTest(null, null, false, 'pt'), scores);
 
             var fullNames = new Array;
             for (var fullName in measuredValuesByFullName)
                 fullNames.push(fullName);
 
-            for (var i = 0; i < fullNames.length; i++) {
-                var values = measuredValuesByFullName[fullNames[i]];
-                PerfTestRunner.reportValues(createTest(fullNames[i], values.aggregator, i + 1 == fullNames.length), values);
+            if (location.search == '?raptor') {
+                var data = ['raptor-benchmark', 'speedometer', measuredValuesByFullName];
+                window.postMessage(data, '*');
+            } else if (typeof tpRecordTime !== "undefined") {
+                var values = new Array;
+                var allNames = new Array;
+                for (var i = 0; i < fullNames.length; i++) {
+                    var vals = measuredValuesByFullName[fullNames[i]];
+                    values.push(vals);
+                    for (var count = 0; count < vals.length; count ++)
+                        allNames.push(fullNames[i]);
+                }
+                tpRecordTime(values.join(','), 0, allNames.join(','));
+            } else if (window.PerfTestRunner) {
+                for (var i = 0; i < fullNames.length; i++) {
+                    var values = measuredValuesByFullName[fullNames[i]];
+                    PerfTestRunner.reportValues(createTest(fullNames[i], values.aggregator, i + 1 == fullNames.length), values);
+                }
             }
         }
     };
 })();