| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """Runs Apple's JetStream benchmark. | 5 """Runs Apple's JetStream benchmark. |
| 6 | 6 |
| 7 JetStream combines a variety of JavaScript benchmarks, covering a variety of | 7 JetStream combines a variety of JavaScript benchmarks, covering a variety of |
| 8 advanced workloads and programming techniques, and reports a single score that | 8 advanced workloads and programming techniques, and reports a single score that |
| 9 balances them using geometric mean. | 9 balances them using geometric mean. |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 page.script_to_evaluate_on_commit = """ | 39 page.script_to_evaluate_on_commit = """ |
| 40 var __results = []; | 40 var __results = []; |
| 41 var __real_log = window.console.log; | 41 var __real_log = window.console.log; |
| 42 window.console.log = function() { | 42 window.console.log = function() { |
| 43 __results.push(Array.prototype.join.call(arguments, ' ')); | 43 __results.push(Array.prototype.join.call(arguments, ' ')); |
| 44 __real_log.apply(this, arguments); | 44 __real_log.apply(this, arguments); |
| 45 } | 45 } |
| 46 """ | 46 """ |
| 47 | 47 |
| 48 def ValidateAndMeasurePage(self, page, tab, results): | 48 def ValidateAndMeasurePage(self, page, tab, results): |
| 49 del page, tab # unused | 49 del page # unused |
| 50 get_results_js = """ | 50 get_results_js = """ |
| 51 (function() { | 51 (function() { |
| 52 for (var i = 0; i < __results.length; i++) { | 52 for (var i = 0; i < __results.length; i++) { |
| 53 if (!__results[i].indexOf('Raw results: ')) return __results[i]; | 53 if (!__results[i].indexOf('Raw results: ')) return __results[i]; |
| 54 } | 54 } |
| 55 return null; | 55 return null; |
| 56 })(); | 56 })(); |
| 57 """ | 57 """ |
| 58 | 58 |
| 59 tab.WaitForDocumentReadyStateToBeComplete() | 59 tab.WaitForDocumentReadyStateToBeComplete() |
| (...skipping 30 matching lines...) Expand all Loading... |
| 90 | 90 |
| 91 def CreateStorySet(self, options): | 91 def CreateStorySet(self, options): |
| 92 ps = story.StorySet( | 92 ps = story.StorySet( |
| 93 archive_data_file='../page_sets/data/jetstream.json', | 93 archive_data_file='../page_sets/data/jetstream.json', |
| 94 base_dir=os.path.dirname(os.path.abspath(__file__)), | 94 base_dir=os.path.dirname(os.path.abspath(__file__)), |
| 95 cloud_storage_bucket=story.INTERNAL_BUCKET) | 95 cloud_storage_bucket=story.INTERNAL_BUCKET) |
| 96 ps.AddStory(page_module.Page( | 96 ps.AddStory(page_module.Page( |
| 97 'http://browserbench.org/JetStream/', ps, ps.base_dir, | 97 'http://browserbench.org/JetStream/', ps, ps.base_dir, |
| 98 make_javascript_deterministic=False)) | 98 make_javascript_deterministic=False)) |
| 99 return ps | 99 return ps |
| OLD | NEW |