OLD | NEW |
---|---|
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """PeaceKeeper benchmark suite. | 5 """PeaceKeeper benchmark suite. |
6 | 6 |
7 Peacekeeper measures browser's performance by testing its JavaScript | 7 Peacekeeper measures browser's performance by testing its JavaScript |
8 functionality. JavaScript is a widely used programming language used in the | 8 functionality. JavaScript is a widely used programming language used in the |
9 creation of modern websites to provide features such as animation, navigation, | 9 creation of modern websites to provide features such as animation, navigation, |
10 forms and other common requirements. By measuring a browser's ability to handle | 10 forms and other common requirements. By measuring a browser's ability to handle |
(...skipping 20 matching lines...) Expand all Loading... | |
31 var __real_log = window.console.log; | 31 var __real_log = window.console.log; |
32 var test_frame = null; | 32 var test_frame = null; |
33 var benchmark = null; | 33 var benchmark = null; |
34 window.console.log = function(msg) { | 34 window.console.log = function(msg) { |
35 if (typeof(msg) == "string" && (msg.indexOf("benchmark")) == 0) { | 35 if (typeof(msg) == "string" && (msg.indexOf("benchmark")) == 0) { |
36 test_frame = document.getElementById("testFrame"); | 36 test_frame = document.getElementById("testFrame"); |
37 benchmark = test_frame.contentWindow.benchmark; | 37 benchmark = test_frame.contentWindow.benchmark; |
38 test_frame.contentWindow.onbeforeunload = {}; | 38 test_frame.contentWindow.onbeforeunload = {}; |
39 if ((msg.indexOf("Submit ok.")) != -1) { | 39 if ((msg.indexOf("Submit ok.")) != -1) { |
40 _done = true; | 40 _done = true; |
41 var __data = {}; | |
42 __results["test"] = benchmark.testObjectName; | 41 __results["test"] = benchmark.testObjectName; |
43 __results["score"] = benchmark.test.result; | 42 __results["score"] = benchmark.test.result; |
44 if (typeof(benchmark.test.unit) != "undefined") { | 43 if (typeof(benchmark.test.unit) != "undefined") { |
45 __results["unit"] = benchmark.test.unit; | 44 __results["unit"] = benchmark.test.unit; |
46 } else { | 45 } else { |
47 __results["unit"] = benchmark.test.isFps ? "fps" : "ops"; | 46 __results["unit"] = benchmark.test.isFps ? "fps" : "ops"; |
48 } | 47 } |
49 } | 48 } |
50 } | 49 } |
51 __real_log.apply(this, [msg]); | 50 __real_log.apply(this, [msg]); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
193 """ | 192 """ |
194 | 193 |
195 tag = 'string' | 194 tag = 'string' |
196 test_param = ['stringChat', | 195 test_param = ['stringChat', |
197 'stringDetectBrowser', | 196 'stringDetectBrowser', |
198 'stringFilter', | 197 'stringFilter', |
199 'stringWeighted', | 198 'stringWeighted', |
200 'stringValidateForm' | 199 'stringValidateForm' |
201 ] | 200 ] |
202 | 201 |
202 | |
203 class PeaceKeeperHTML5Canvas(PeaceKeeperBenchmark): | |
204 """PeaceKeeper HTML5 Canvas benchmark suite. | |
tonyg
2013/11/12 02:07:53
Thanks again for all the great comments in the ben
| |
205 | |
206 These tests use HTML5 Canvas, which is a web technology for drawing and | |
207 manipulating graphics without external plug-ins. | |
208 1. experimentalRipple01: Simulates a 'water ripple' effect by using HTML 5 | |
209 Canvas. It measures the browser's ability to draw individual pixels. | |
210 2. experimentalRipple02: Same test as 'experimentalRipple01', but with a | |
211 larger canvas and thus a heavier workload. | |
212 """ | |
213 | |
214 tag = 'experimental' | |
215 test_param = ['experimentalRipple01', | |
216 'experimentalRipple02' | |
217 ] | |
218 | |
219 | |
220 class PeaceKeeperHTML5Capabilities(PeaceKeeperBenchmark): | |
221 """PeaceKeeper HTML5 Capabilities benchmark suite. | |
222 | |
223 These tests checks browser HTML5 capabilities support for WebGL, Video | |
224 foramts, simple 2D sprite based games and web worker. | |
225 This benchmark only tests HTML5 capability and thus is not calculate into the | |
226 overall score. | |
227 1. HTML5 - WebGL: WebGL allows full blown 3D graphics to be rendered in a | |
228 browser without the need for any external plug-ins. | |
229 a) webglSphere | |
230 2. HTML5 - Video: hese tests find out which HTML5 video formats are supposed | |
231 by your browser. Peacekeeper only checks if your browser is able to play a | |
232 specific format, no other valuation is done. | |
233 a) videoCodecH264 | |
234 b) videoCodecTheora | |
235 c) videoCodecWebM | |
236 d) videoPosterSupport | |
237 3.HTML5 - Web Worker: These tests use HTML5 Web Worker, which allows | |
238 JavaScript to multhread - ie. the ability to perform multiple actions | |
239 concurrently. | |
240 a) workerContrast01 | |
241 b) workerContrast02 | |
242 4. HTML5 - Game: This test simulates a simple 2D, sprite-based game. | |
243 The test itself is the real game, and what is shown is a recorded play. | |
244 a) gamingSpitfire | |
245 """ | |
246 | |
247 tag = 'html5' | |
248 test_param = ['webglSphere', | |
249 'gamingSpitfire', | |
250 'videoCodecH264', | |
251 'videoCodecTheora', | |
252 'videoCodecWebM', | |
253 'videoPosterSupport', | |
254 'workerContrast01', | |
255 'workerContrast02' | |
256 ] | |
257 | |
OLD | NEW |