| 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 # pylint: disable=W0401,W0614 | 4 # pylint: disable=W0401,W0614 |
| 5 from telemetry.page.actions.all_page_actions import * | 5 from telemetry.page.actions.all_page_actions import * |
| 6 from telemetry.page import page as page_module | 6 from telemetry.page import page as page_module |
| 7 from telemetry.page import page_set as page_set_module | 7 from telemetry.page import page_set as page_set_module |
| 8 from measurements import polymer_load |
| 8 | 9 |
| 9 | 10 |
| 10 class PicaPage(page_module.PageWithDefaultRunNavigate): | 11 class PicaPage(polymer_load.PageForPolymerLoad): |
| 11 | 12 |
| 12 def __init__(self, page_set): | 13 def __init__(self, page_set): |
| 13 super(PicaPage, self).__init__( | 14 super(PicaPage, self).__init__( |
| 14 url='http://localhost/polymer/projects/pica/', | 15 url='http://localhost/polymer/projects/pica/', |
| 15 page_set=page_set) | 16 page_set=page_set) |
| 16 self.archive_data_file = 'data/pica.json' | 17 self.archive_data_file = 'data/pica.json' |
| 17 self.script_to_evaluate_on_commit = ''' | |
| 18 document.addEventListener('polymer-ready', function() { | |
| 19 var unused = document.body.offsetHeight; | |
| 20 window.__pica_load_time = performance.now(); | |
| 21 setTimeout(function(){window.__polymer_ready=true}, 1000) | |
| 22 })''' | |
| 23 | |
| 24 def RunNavigateSteps(self, action_runner): | |
| 25 action_runner.RunAction(NavigateAction()) | |
| 26 action_runner.RunAction(WaitAction( | |
| 27 { | |
| 28 'javascript': 'window.__polymer_ready' | |
| 29 })) | |
| 30 | 18 |
| 31 | 19 |
| 32 class PicaPageSet(page_set_module.PageSet): | 20 class PicaPageSet(page_set_module.PageSet): |
| 33 | 21 |
| 34 """ Pica demo app for the Polymer UI toolkit """ | 22 """ Pica demo app for the Polymer UI toolkit """ |
| 35 | 23 |
| 36 def __init__(self): | 24 def __init__(self): |
| 37 super(PicaPageSet, self).__init__( | 25 super(PicaPageSet, self).__init__( |
| 38 archive_data_file='data/pica.json') | 26 archive_data_file='data/pica.json') |
| 39 | 27 |
| 40 self.AddPage(PicaPage(self)) | 28 self.AddPage(PicaPage(self)) |
| OLD | NEW |