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 # pylint: disable=W0401,W0614
      5 from telemetry.page.actions.all_page_actions import *
      6 from telemetry.page import page as page_module
      7 from telemetry.page import page_set as page_set_module
      8 
      9 
     10 class ToughCanvasCasesPage(page_module.Page):
     11 
     12   def __init__(self, url, page_set):
     13     super(ToughCanvasCasesPage, self).__init__(url=url, page_set=page_set)
     14     self.archive_data_file = 'data/tough_canvas_cases.json'
     15 
     16   def RunNavigateSteps(self, action_runner):
     17     action_runner.NavigateToPage(self)
     18     action_runner.WaitForJavaScriptCondition(
     19         "document.readyState == 'complete'")
     20 
     21   def RunSmoothness(self, action_runner):
     22     action_runner.Wait(5)
     23 
     24 
     25 class MicrosofFirefliesPage(ToughCanvasCasesPage):
     26 
     27   def __init__(self, page_set):
     28     super(MicrosofFirefliesPage, self).__init__(
     29       # pylint: disable=C0301
     30       url='http://ie.microsoft.com/testdrive/Performance/Fireflies/Default.html',
     31       page_set=page_set)
     32 
     33     self.disabled = 'Crashes on Galaxy Nexus. crbug.com/314131'
     34 
     35 
     36 class ToughCanvasCasesPageSet(page_set_module.PageSet):
     37 
     38   """
     39   Description: Self-driven Canvas2D animation examples
     40   """
     41 
     42   def __init__(self):
     43     super(ToughCanvasCasesPageSet, self).__init__(
     44       archive_data_file='data/tough_canvas_cases.json',
     45       bucket=page_set_module.PARTNER_BUCKET)
     46 
     47     self.AddPage(MicrosofFirefliesPage(self))
     48 
     49     # Failing on Nexus 5 (http://crbug.com/364248):
     50     # 'http://geoapis.appspot.com/agdnZW9hcGlzchMLEgtFeGFtcGxlQ29kZRjh1wIM',
     51 
     52     urls_list = [
     53       'http://mudcu.be/labs/JS1k/BreathingGalaxies.html',
     54       'http://runway.countlessprojects.com/prototype/performance_test.html',
     55       # pylint: disable=C0301
     56       'http://ie.microsoft.com/testdrive/Performance/FishIETank/Default.html',
     57       'http://ie.microsoft.com/testdrive/Performance/SpeedReading/Default.html',
     58       'http://acko.net/dumpx/996b.html',
     59       'http://www.kevs3d.co.uk/dev/canvask3d/k3d_test.html',
     60       'http://www.megidish.net/awjs/',
     61       'http://themaninblue.com/experiment/AnimationBenchmark/canvas/',
     62       'http://mix10k.visitmix.com/Entry/Details/169',
     63       'http://www.craftymind.com/factory/guimark2/HTML5ChartingTest.html',
     64       'http://www.chiptune.com/starfield/starfield.html',
     65       'http://jarrodoverson.com/static/demos/particleSystem/',
     66       'http://www.effectgames.com/demos/canvascycle/',
     67       'http://www.thewildernessdowntown.com/',
     68       'http://spielzeugz.de/html5/liquid-particles.html',
     69       'http://hakim.se/experiments/html5/magnetic/02/',
     70       'http://ie.microsoft.com/testdrive/Performance/LetItSnow/',
     71       'http://ie.microsoft.com/testdrive/Graphics/WorkerFountains/Default.html',
     72       'http://ie.microsoft.com/testdrive/Graphics/TweetMap/Default.html',
     73       'http://ie.microsoft.com/testdrive/Graphics/VideoCity/Default.html',
     74       'http://ie.microsoft.com/testdrive/Performance/AsteroidBelt/Default.html',
     75       'http://www.smashcat.org/av/canvas_test/',
     76       # pylint: disable=C0301
     77       'file://tough_canvas_cases/canvas2d_balls_common/bouncing_balls.html?ball=canvas_sprite&back=canvas',
     78       # pylint: disable=C0301
     79       'file://tough_canvas_cases/canvas2d_balls_common/bouncing_balls.html?ball=image_with_shadow&back=image',
     80       # pylint: disable=C0301
     81       'file://tough_canvas_cases/canvas2d_balls_common/bouncing_balls.html?ball=filled_path&back=gradient',
     82       # pylint: disable=C0301
     83       'file://tough_canvas_cases/canvas2d_balls_common/bouncing_balls.html?ball=text&back=white&ball_count=15',
     84       'file://tough_canvas_cases/canvas-animation-no-clear.html',
     85       'file://../../../chrome/test/data/perf/canvas_bench/single_image.html',
     86       'file://../../../chrome/test/data/perf/canvas_bench/many_images.html'
     87     ]
     88 
     89     for url in urls_list:
     90       self.AddPage(ToughCanvasCasesPage(url, self))
     91