summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/test/data/gpu/pixel_background.html53
-rw-r--r--content/test/gpu/page_sets/gpu_rasterization_tests.py20
2 files changed, 62 insertions, 11 deletions
diff --git a/content/test/data/gpu/pixel_background.html b/content/test/data/gpu/pixel_background.html
new file mode 100644
index 0000000..e3ec20a
--- /dev/null
+++ b/content/test/data/gpu/pixel_background.html
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta name="viewport" content="initial-scale=1">
+<title>Basic Rasterization Test: Blue Box over Black Background</title>
+<style type="text/css">
+body {
+ margin: 0px;
+ padding: 0px;
+ background-color: white;
+}
+#container {
+ position: relative;
+ margin: 10px;
+ width: 200px;
+ height: 200px;
+ background-color: black;
+}
+#blue_box {
+ position: relative;
+ top: 50px;
+ left: 50px;
+ width: 100px;
+ height: 100px;
+ background-color: blue;
+}
+</style>
+<script>
+var g_swapsBeforeAck = 15;
+
+function main() {
+ waitForFinish();
+}
+
+function waitForFinish()
+{
+ if (g_swapsBeforeAck == 0) {
+ domAutomationController.setAutomationId(1);
+ domAutomationController.send("SUCCESS");
+ } else {
+ g_swapsBeforeAck--;
+ document.getElementById('blue_box').style.zIndex = g_swapsBeforeAck + 1;
+ window.webkitRequestAnimationFrame(waitForFinish);
+ }
+}
+</script>
+</head>
+
+<body onload="main()">
+<div id="container">
+ <div id="blue_box"></div>
+</div>
+</body>
+</html>
diff --git a/content/test/gpu/page_sets/gpu_rasterization_tests.py b/content/test/gpu/page_sets/gpu_rasterization_tests.py
index 6c23e6c..e6a338f 100644
--- a/content/test/gpu/page_sets/gpu_rasterization_tests.py
+++ b/content/test/gpu/page_sets/gpu_rasterization_tests.py
@@ -11,11 +11,10 @@ class GpuRasterizationTestsPage(page_module.Page):
def __init__(self, page_set):
super(GpuRasterizationTestsPage, self).__init__(
- url='file://../../data/gpu/pixel_css3d.html',
+ url='file://../../data/gpu/pixel_background.html',
page_set=page_set,
- name='GpuRasterization.CSS3DBlueBox')
+ name='GpuRasterization.BlueBox')
- self.user_agent_type = 'desktop'
self.expectations = [
{'comment': 'body-t',
'color': [255, 255, 255],
@@ -24,15 +23,15 @@ class GpuRasterizationTestsPage(page_module.Page):
{'comment': 'body-r',
'color': [255, 255, 255],
'tolerance': 0,
- 'location': [245, 5]},
+ 'location': [215, 5]},
{'comment': 'body-b',
'color': [255, 255, 255],
'tolerance': 0,
- 'location': [245, 245]},
+ 'location': [215, 215]},
{'comment': 'body-l',
'color': [255, 255, 255],
'tolerance': 0,
- 'location': [5, 245]},
+ 'location': [5, 215]},
{'comment': 'background-t',
'color': [0, 0, 0],
'tolerance': 0,
@@ -60,13 +59,13 @@ class GpuRasterizationTestsPage(page_module.Page):
{'comment': 'box-b',
'color': [0, 0, 255],
'tolerance': 0,
- 'location': [140, 120]},
+ 'location': [140, 140]},
{'comment': 'box-l',
'color': [0, 0, 255],
'tolerance': 0,
- 'location': [70, 120]}
+ 'location': [70, 140]}
]
- self.test_rect = [0, 0, 250, 250]
+ self.test_rect = [0, 0, 220, 220]
def RunNavigateSteps(self, action_runner):
action_runner.NavigateToPage(self)
@@ -82,7 +81,6 @@ class GpuRasterizationTestsPageSet(page_set_module.PageSet):
""" Basic test cases for GPU rasterization. """
def __init__(self):
- super(GpuRasterizationTestsPageSet, self).__init__(
- user_agent_type='desktop')
+ super(GpuRasterizationTestsPageSet, self).__init__()
self.AddPage(GpuRasterizationTestsPage(self))