X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontent%2Ftest%2Fgpu%2Fgpu_tests%2Fmaps.py;h=bb431fb55f73c68a10210891974a0623a11b4734;hb=004985e17e624662a4c85c76a7654039dc83f028;hp=bb95a410722f81b6c3c93957eb4275771c7255cf;hpb=2f108dbacb161091e42a3479f4e171339b7e7623;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/content/test/gpu/gpu_tests/maps.py b/src/content/test/gpu/gpu_tests/maps.py index bb95a41..bb431fb 100644 --- a/src/content/test/gpu/gpu_tests/maps.py +++ b/src/content/test/gpu/gpu_tests/maps.py @@ -16,13 +16,13 @@ import maps_expectations from telemetry import test from telemetry.core import bitmap from telemetry.core import util -from telemetry.page import page_test +from telemetry.page import page from telemetry.page import page_set +from telemetry.page import page_test +# pylint: disable=W0401,W0614 +from telemetry.page.actions.all_page_actions import * class _MapsValidator(cloud_storage_test_base.ValidatorBase): - def __init__(self): - super(_MapsValidator, self).__init__('ValidatePage') - def CustomizeBrowserOptions(self, options): options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') @@ -72,6 +72,21 @@ class _MapsValidator(cloud_storage_test_base.ValidatorBase): json_contents = json.load(f) return json_contents + +class MapsPage(page.Page): + def __init__(self, page_set, base_dir): + super(MapsPage, self).__init__( + url='http://localhost:10020/tracker.html', + page_set=page_set, + base_dir=base_dir, + name='Maps.maps_002') + self.pixel_expectations = 'data/maps_002_expectations.json' + + def RunNavigateSteps(self, action_runner): + action_runner.RunAction(NavigateAction()) + action_runner.RunAction(WaitAction({'javascript': 'window.testDone'})) + + class Maps(cloud_storage_test_base.TestBase): """Google Maps pixel tests.""" test = _MapsValidator @@ -82,24 +97,8 @@ class Maps(cloud_storage_test_base.TestBase): def CreatePageSet(self, options): page_set_path = os.path.join( util.GetChromiumSrcDir(), 'content', 'test', 'gpu', 'page_sets') - page_set_dict = { - 'archive_data_file': 'data/maps.json', - 'make_javascript_deterministic': False, - 'pages': [ - { - 'name': 'Maps.maps_001', - 'url': 'http://localhost:10020/tracker.html', - # TODO: Hack to prevent maps from scaling due to window size. - # Remove when the maps team provides a better way of overriding this - # behavior - 'script_to_evaluate_on_commit': 'window.screen = null;', - 'navigate_steps': [ - { 'action': 'navigate' }, - { 'action': 'wait', 'javascript': 'window.testDone' } - ], - 'pixel_expectations': 'data/maps_001_expectations.json' - } - ] - } - - return page_set.PageSet.FromDict(page_set_dict, page_set_path) + ps = page_set.PageSet(archive_data_file='data/maps.json', + make_javascript_deterministic=False, + file_path=page_set_path) + ps.AddPage(MapsPage(ps, ps.base_dir)) + return ps