| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 from telemetry.page import page as page_module | 5 from telemetry.page import page as page_module |
| 6 from telemetry.page import shared_page_state | 6 from telemetry.page import shared_page_state |
| 7 from telemetry import story | 7 from telemetry import story |
| 8 | 8 |
| 9 | 9 |
| 10 URL_LIST = [ | 10 URL_LIST = [ |
| 11 ('Polymer', 'http://todomvc.com/examples/polymer'), | 11 ('Polymer', 'http://todomvc.com/examples/polymer'), |
| 12 ('AngularJS', 'http://todomvc.com/examples/angularjs'), | 12 ('AngularJS', 'http://todomvc.com/examples/angularjs'), |
| 13 ('React', 'http://todomvc.com/examples/react'), | 13 ('React', 'http://todomvc.com/examples/react'), |
| 14 ('Backbone.js', 'http://todomvc.com/examples/backbone'), | 14 ('Backbone.js', 'http://todomvc.com/examples/backbone'), |
| 15 ('Ember.js', 'http://todomvc.com/examples/emberjs'), | 15 ('Ember.js', 'http://todomvc.com/examples/emberjs'), |
| 16 ('Closure', 'http://todomvc.com/examples/closure'), | 16 ('Closure', 'http://todomvc.com/examples/closure'), |
| 17 ('GWT', 'http://todomvc.com/examples/gwt'), | 17 ('GWT', 'http://todomvc.com/examples/gwt'), |
| 18 ('Dart', 'http://todomvc.com/examples/vanilladart/build/web'), | 18 ('Dart', 'http://todomvc.com/examples/vanilladart/build/web'), |
| 19 ('Vanilla JS', 'http://todomvc.com/examples/vanillajs'), | 19 ('Vanilla JS', 'http://todomvc.com/examples/vanillajs'), |
| 20 ] | 20 ] |
| 21 | 21 |
| 22 INTERACTION_NAME = 'Interaction.AppLoad' | 22 INTERACTION_NAME = 'Interaction.AppLoad' |
| 23 | 23 |
| 24 | 24 |
| 25 class TodoMVCPage(page_module.Page): | 25 class TodoMVCPage(page_module.Page): |
| 26 | 26 |
| 27 def __init__(self, url, page_set, name): | 27 def __init__(self, url, page_set, name): |
| 28 super(TodoMVCPage, self).__init__( | 28 super(TodoMVCPage, self).__init__( |
| 29 url=url, page_set=page_set, name=name, | 29 url=url, page_set=page_set, name=name, |
| 30 startup_url='about:blank', |
| 30 shared_page_state_class=shared_page_state.SharedDesktopPageState) | 31 shared_page_state_class=shared_page_state.SharedDesktopPageState) |
| 31 # TODO(jochen): This interaction does not include the | 32 # TODO(jochen): This interaction does not include the |
| 32 # WindowProxy::initialize portion before the commit. To fix this, we'll | 33 # WindowProxy::initialize portion before the commit. To fix this, we'll |
| 33 # have to migrate to TBMv2. | 34 # have to migrate to TBMv2. |
| 34 self.script_to_evaluate_on_commit = ( | 35 self.script_to_evaluate_on_commit = ( |
| 35 'console.time("%s");' % INTERACTION_NAME) | 36 'console.time("%s");' % INTERACTION_NAME) |
| 36 | 37 |
| 37 def RunPageInteractions(self, action_runner): | 38 def RunPageInteractions(self, action_runner): |
| 38 action_runner.ExecuteJavaScript( | 39 action_runner.ExecuteJavaScript( |
| 39 """ | 40 """ |
| (...skipping 15 matching lines...) Expand all Loading... |
| 55 | 56 |
| 56 """ TodoMVC examples """ | 57 """ TodoMVC examples """ |
| 57 | 58 |
| 58 def __init__(self): | 59 def __init__(self): |
| 59 super(TodoMVCPageSet, self).__init__( | 60 super(TodoMVCPageSet, self).__init__( |
| 60 archive_data_file='data/todomvc.json', | 61 archive_data_file='data/todomvc.json', |
| 61 cloud_storage_bucket=story.PUBLIC_BUCKET) | 62 cloud_storage_bucket=story.PUBLIC_BUCKET) |
| 62 | 63 |
| 63 for name, url in URL_LIST: | 64 for name, url in URL_LIST: |
| 64 self.AddStory(TodoMVCPage(url, self, name)) | 65 self.AddStory(TodoMVCPage(url, self, name)) |
| OLD | NEW |