Home | History | Annotate | Download | only in page_sets
      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
      3 # found in the LICENSE file.
      4 
      5 import logging
      6 
      7 from telemetry.page import page as page_module
      8 from telemetry.page import page_set as page_set_module
      9 
     10 
     11 class MapsPage(page_module.Page):
     12 
     13   def __init__(self, page_set):
     14     super(MapsPage, self).__init__(
     15       url='http://localhost:10020/tracker.html',
     16       page_set=page_set,
     17       name='Maps.maps_002')
     18     self.archive_data_file = 'data/maps.json'
     19 
     20   def CanRunOnBrowser(self, browser_info):
     21     if not browser_info.HasWebGLSupport():
     22       logging.warning('Browser does not support webgl, skipping test')
     23       return False
     24     return True
     25 
     26   def RunNavigateSteps(self, action_runner):
     27     action_runner.NavigateToPage(self)
     28     action_runner.Wait(3)
     29 
     30   def RunSmoothness(self, action_runner):
     31     action_runner.WaitForJavaScriptCondition('window.testDone', 120)
     32 
     33 
     34 class MapsPageSet(page_set_module.PageSet):
     35 
     36   """ Google Maps examples """
     37 
     38   def __init__(self):
     39     super(MapsPageSet, self).__init__(
     40         archive_data_file='data/maps.json',
     41         bucket=page_set_module.PUBLIC_BUCKET)
     42 
     43     self.AddPage(MapsPage(self))
     44