OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import unittest | 5 import unittest |
6 | 6 |
7 from webkitpy.layout_tests.controllers import repaint_overlay | 7 from webkitpy.layout_tests.controllers import repaint_overlay |
8 | 8 |
9 | 9 |
10 LAYER_TREE = """{ | 10 LAYER_TREE = """{ |
11 "bounds":[800.00,600.00], | 11 "bounds":[800.00,600.00], |
12 "children":[ | 12 "children":[ |
13 { | 13 { |
14 "position": [8.00, 80.00], | 14 "position": [8.00, 80.00], |
15 "bounds": [800.00, 600.00], | 15 "bounds": [800.00, 600.00], |
16 "contentsOpaque": true, | 16 "contentsOpaque": true, |
17 "drawsContent": true, | 17 "drawsContent": true, |
18 "repaintRects": [ | 18 "repaintRects": [ |
19 [8, 108, 100, 100], | 19 [8, 108, 100, 100], |
20 [0, 216, 800, 100] | 20 [0, 216, 800, 100] |
21 ] | 21 ] |
22 } | 22 } |
23 ] | 23 ] |
24 } | 24 } |
25 """ | 25 """ |
26 | 26 |
| 27 |
27 class TestRepaintOverlay(unittest.TestCase): | 28 class TestRepaintOverlay(unittest.TestCase): |
| 29 |
28 def test_result_contains_repaint_rects(self): | 30 def test_result_contains_repaint_rects(self): |
29 self.assertTrue(repaint_overlay.result_contains_repaint_rects(LAYER_TREE
)) | 31 self.assertTrue(repaint_overlay.result_contains_repaint_rects(LAYER_TREE
)) |
30 self.assertFalse(repaint_overlay.result_contains_repaint_rects('ABCD')) | 32 self.assertFalse(repaint_overlay.result_contains_repaint_rects('ABCD')) |
31 | 33 |
32 def test_extract_layer_tree(self): | 34 def test_extract_layer_tree(self): |
33 self.assertEquals(LAYER_TREE, repaint_overlay.extract_layer_tree(LAYER_T
REE)) | 35 self.assertEquals(LAYER_TREE, repaint_overlay.extract_layer_tree(LAYER_T
REE)) |
OLD | NEW |