| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 del page # unused | 49 del page # unused |
| 50 tab.WaitForDocumentReadyStateToBeComplete() | 50 tab.WaitForDocumentReadyStateToBeComplete() |
| 51 tab.EvaluateJavaScript('JetStream.start()') | 51 tab.EvaluateJavaScript('JetStream.start()') |
| 52 result = tab.WaitForJavaScriptCondition(""" | 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=60*12) | 59 """, timeout=60*20) |
| 60 result = json.loads(result.partition(': ')[2]) | 60 result = json.loads(result.partition(': ')[2]) |
| 61 | 61 |
| 62 all_score_lists = [] | 62 all_score_lists = [] |
| 63 for k, v in result.iteritems(): | 63 for k, v in result.iteritems(): |
| 64 results.AddValue(list_of_scalar_values.ListOfScalarValues( | 64 results.AddValue(list_of_scalar_values.ListOfScalarValues( |
| 65 results.current_page, k.replace('.', '_'), 'score', v['result'], | 65 results.current_page, k.replace('.', '_'), 'score', v['result'], |
| 66 important=False)) | 66 important=False)) |
| 67 # Collect all test scores to compute geometric mean. | 67 # Collect all test scores to compute geometric mean. |
| 68 for i, score in enumerate(v['result']): | 68 for i, score in enumerate(v['result']): |
| 69 if len(all_score_lists) <= i: | 69 if len(all_score_lists) <= i: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 85 | 85 |
| 86 def CreateStorySet(self, options): | 86 def CreateStorySet(self, options): |
| 87 ps = story.StorySet( | 87 ps = story.StorySet( |
| 88 archive_data_file='../page_sets/data/jetstream.json', | 88 archive_data_file='../page_sets/data/jetstream.json', |
| 89 base_dir=os.path.dirname(os.path.abspath(__file__)), | 89 base_dir=os.path.dirname(os.path.abspath(__file__)), |
| 90 cloud_storage_bucket=story.INTERNAL_BUCKET) | 90 cloud_storage_bucket=story.INTERNAL_BUCKET) |
| 91 ps.AddStory(page_module.Page( | 91 ps.AddStory(page_module.Page( |
| 92 'http://browserbench.org/JetStream/', ps, ps.base_dir, | 92 'http://browserbench.org/JetStream/', ps, ps.base_dir, |
| 93 make_javascript_deterministic=False)) | 93 make_javascript_deterministic=False)) |
| 94 return ps | 94 return ps |
| OLD | NEW |