| 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 30 matching lines...) Expand all Loading... |
| 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 # unused | 49 del page # unused |
| 50 tab.WaitForDocumentReadyStateToBeComplete() | 50 tab.WaitForDocumentReadyStateToBeComplete() |
| 51 tab.EvaluateJavaScript2('JetStream.start()') | 51 tab.EvaluateJavaScript('JetStream.start()') |
| 52 result = tab.WaitForJavaScriptCondition2(""" | 52 result = tab.WaitForJavaScriptCondition(""" |
| 53 (function() { | 53 (function() { |
| 54 for (var i = 0; i < __results.length; i++) { | 54 for (var i = 0; i < __results.length; i++) { |
| 55 if (!__results[i].indexOf('Raw results: ')) return __results[i]; | 55 if (!__results[i].indexOf('Raw results: ')) return __results[i]; |
| 56 } | 56 } |
| 57 return null; | 57 return null; |
| 58 })(); | 58 })(); |
| 59 """, timeout=600) | 59 """, timeout=600) |
| 60 result = json.loads(result.partition(': ')[2]) | 60 result = json.loads(result.partition(': ')[2]) |
| 61 | 61 |
| 62 all_score_lists = [] | 62 all_score_lists = [] |
| (...skipping 23 matching lines...) Expand all Loading... |
| 86 | 86 |
| 87 def CreateStorySet(self, options): | 87 def CreateStorySet(self, options): |
| 88 ps = story.StorySet( | 88 ps = story.StorySet( |
| 89 archive_data_file='../page_sets/data/jetstream.json', | 89 archive_data_file='../page_sets/data/jetstream.json', |
| 90 base_dir=os.path.dirname(os.path.abspath(__file__)), | 90 base_dir=os.path.dirname(os.path.abspath(__file__)), |
| 91 cloud_storage_bucket=story.INTERNAL_BUCKET) | 91 cloud_storage_bucket=story.INTERNAL_BUCKET) |
| 92 ps.AddStory(page_module.Page( | 92 ps.AddStory(page_module.Page( |
| 93 'http://browserbench.org/JetStream/', ps, ps.base_dir, | 93 'http://browserbench.org/JetStream/', ps, ps.base_dir, |
| 94 make_javascript_deterministic=False)) | 94 make_javascript_deterministic=False)) |
| 95 return ps | 95 return ps |
| OLD | NEW |