Upstream version 8.37.180.0
[platform/framework/web/crosswalk.git] / src / content / test / gpu / page_sets / gpu_rasterization_tests.py
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 GpuRasterizationTestsPage(page_module.Page):
11
12   def __init__(self, page_set):
13     super(GpuRasterizationTestsPage, self).__init__(
14       url='file://../../data/gpu/pixel_background.html',
15       page_set=page_set,
16       name='GpuRasterization.BlueBox')
17
18     self.expectations = [
19       {'comment': 'body-t',
20        'color': [255, 255, 255],
21        'tolerance': 0,
22        'location': [5, 5]},
23       {'comment': 'body-r',
24        'color': [255, 255, 255],
25        'tolerance': 0,
26        'location': [215, 5]},
27       {'comment': 'body-b',
28        'color': [255, 255, 255],
29        'tolerance': 0,
30        'location': [215, 215]},
31       {'comment': 'body-l',
32        'color': [255, 255, 255],
33        'tolerance': 0,
34        'location': [5, 215]},
35       {'comment': 'background-t',
36        'color': [0, 0, 0],
37        'tolerance': 0,
38        'location': [30, 30]},
39       {'comment': 'background-r',
40        'color': [0, 0, 0],
41        'tolerance': 0,
42        'location': [170, 30]},
43       {'comment': 'background-b',
44        'color': [0, 0, 0],
45        'tolerance': 0,
46        'location': [170, 170]},
47       {'comment': 'background-l',
48        'color': [0, 0, 0],
49        'tolerance': 0,
50        'location': [30, 170]},
51       {'comment': 'box-t',
52        'color': [0, 0, 255],
53        'tolerance': 0,
54        'location': [70, 70]},
55       {'comment': 'box-r',
56        'color': [0, 0, 255],
57        'tolerance': 0,
58        'location': [140, 70]},
59       {'comment': 'box-b',
60        'color': [0, 0, 255],
61        'tolerance': 0,
62        'location': [140, 140]},
63       {'comment': 'box-l',
64        'color': [0, 0, 255],
65        'tolerance': 0,
66        'location': [70, 140]}
67     ]
68     self.test_rect = [0, 0, 220, 220]
69
70   def RunNavigateSteps(self, action_runner):
71     action_runner.NavigateToPage(self)
72     action_runner.WaitForJavaScriptCondition(
73         'domAutomationController._finished', timeout=30)
74
75
76 class GpuRasterizationTestsPageSet(page_set_module.PageSet):
77
78   """ Basic test cases for GPU rasterization. """
79
80   def __init__(self):
81     super(GpuRasterizationTestsPageSet, self).__init__()
82
83     self.AddPage(GpuRasterizationTestsPage(self))