| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import os | 4 import os |
| 5 | 5 |
| 6 import chrome_remote_control | 6 import chrome_remote_control |
| 7 | 7 |
| 8 import multi_page_benchmark | 8 import multi_page_benchmark |
| 9 import scrolling_benchmark | 9 import scrolling_benchmark |
| 10 | 10 |
| 11 | 11 |
| 12 class TextureUploadBenchmark(scrolling_benchmark.ScrollingBenchmark): | 12 class TextureUploadBenchmark(scrolling_benchmark.ScrollingBenchmark): |
| 13 def MeasurePage(self, page, tab): | 13 def MeasurePage(self, page, tab): |
| 14 rendering_stats = self.ScrollPageFully(tab) | 14 rendering_stats = self.ScrollPageFully(tab) |
| 15 |
| 16 if rendering_stats["totalCommitCount"] == 0 : |
| 17 averageCommitTimeMs = 0 |
| 18 else : |
| 19 averageCommitTimeMs = (1000 * rendering_stats["totalCommitTimeInSeconds"] |
| 20 / rendering_stats["totalCommitCount"]) |
| 21 |
| 15 return { | 22 return { |
| 16 "texture_upload_count": rendering_stats["textureUploadCount"] | 23 "texture_upload_count": rendering_stats["textureUploadCount"], |
| 24 "average_commit_time_ms": averageCommitTimeMs |
| 17 } | 25 } |
| 18 | 26 |
| 19 def Main(): | 27 def Main(): |
| 20 return multi_page_benchmark.Main(TextureUploadBenchmark()) | 28 return multi_page_benchmark.Main(TextureUploadBenchmark()) |
| OLD | NEW |